User's Manual

Example 29 Reporting program complexity metrics
$ cadvise report -pdb gzip.pdb +metrics -include "inflate.c"
================================================================================
Begin program complexity data for /vws/cal-bear_2/zhang/gzip-1.2.4a/inflate.c
================================================================================
File level program complexity data :
------------------------------------
Include Files: 4
Total Lines: 954
Blank Lines: 211
Comment Lines: 248
Lines Of Code: 495
Mixed Lines: 155
No. of Globals: 6
No. of Statics: 5
No. of Functions: 8
No. of Extern Functions: 8
Function level program complexity data :
----------------------------------------
Begin Function: huft_build
Signature: int huft_build()
Total Lines: 182
Blank Lines: 40
Comment Lines: 22
Lines of Code: 120
Mixed Lines: 65
No. of Macros Used: 13
No. of Locals: 19
No. of statics: 0
No. of Ifs: 15
No. of Returns: 5
No. of Loops: 7
...
NOTE: A variant of the +metrics option is +metrics[=ict] that prints the number of indirect
call targets. For information on the program complexity metrics emitted with this option, see
“Generating code complexity metrics (page 13).
6.12 Generating report for a module
The -module <name> option generates analysis report for the source files of the module <name>.
A module is a subdirectory of the application's source files. The following example shows the report
for a source file of a module.
6.12 Generating report for a module 33