Source Code Metrics
Understand is very efficient at collecting metrics about the code it analyzes. These metrics can be extracted automatically via command line calls, exported to spreadsheets, viewed graphically, dynamically explored in the GUI, or customized via the Understand Perl API. They can also be reported at the project level, for files, classes, functions or user defined architectures.
Most of the metrics in Understand can be categorized in the following groups:
- Complexity Metrics (e.g. McCabe Cyclomatic)
- Volume Metrics (e.g Lines of Code)
- Object Oriented (e.g. Coupling Between Object Classes)
We don’t push a particular coding methodology and we consider ourselves “Metric Agnostic”. We won’t tell you that your code is “good” or “bad” we just try to report the data in the most flexible manner possible and let your team interpret it however you think best. Click here for a list of all available metrics, and Click here for a detailed description describing how many of the C++ metrics are implemented.
To help you develop custom metrics there is a full Perl API interface to the Understand database as well as a fully developed plugin mechanism. For example, there is a sample Perl API script that ships with Understand that generates the Halstead Maintainability Index for every file and function in your project.