FPC-Understand is a Free Pascal code analysing tool written in Free Pascal. It's main purpose is to statically analyse Free Pascal code and give easy access to it's architecture informations.
These informations are:
- Unit dependencies
- Class hierarchy
- Statisics like: lines of code, cyclomatic complexity ...
- Reviewsupport by code editing and commentingmask
The included source editor has a comment function. The created comments can be exported as .csv.
The program is mainly designed to work with Lazarus .lpi files, but it is not forced to use .lpi files.
All statistics and analyses are exportable in .csv file format (except the unit dependency graph this is exported as .png)
Compile the code using Lazarus 2.2.0 or higher, all plattforms where you can run Lazarus on should be able to compile and run FPC Understand as it is not dependand to any higher level library.
- Start the program click "Edit" -> "Project settings"
- Fill in the Name in page "General"
- Select a .lpi file (second "select" button from top) in Page "Files"
- [Optional] Add further files that are not included in the selected .lpi file (or edit the .lpi file to correct includings)
- click ok
Use right mouse context menu to center nodes that are created outside the visible screen.
Click and drag nodes.
Use left mouse button to create a rectangle for selecting multiple nodes. Holding "shift" while clicking on nodes will add them to a selected collection.
- Select none (= all) or as much nodes you want to get the calculations of
- Open the wanted calculation via "Edit" -> "Show *" or by double clicking on one of the selected nodes
-
The graph component does not support "same" filenames in the project.
-> If your project contains 2 .pas files with same name but in different locations the graph will merge them into one single node, this will produce invalid dependencies
-
The callgraph analysis is more a heuristic than a real code "understanding"
-> function pointers are not evaluated, function calls that have the same name are merged into the same node (see "same" filename issue)