Number of if statements

Number of return statements

Number of loop nests

Nesting level of each loop nest

Number of indirect calls

Number of direct calls

Targets of direct calls

Cyclomatic complexity

Cyclomatic complexity without switch

Cyclomatic complexity without exception handling

Cyclomatic complexity without switch and exception handling

Number of Thread Local Storage (TLS) variables

Number of mutexes

Number of lock calls

Number of unlock calls

For each indirect call site, cadvise emits the list of possible call targets.

Cyclomatic Complexity

Cyclomatic complexity metric, developed by Thomas McCabe in 1976 ,measures the number of linearly-independent paths through a program module. It is an indicator for understandability and testability of a module. A lower value indicates more understandable and testable code. The +metrics option emits cyclomatic complexity by default.

Indirect Call Targets

This refers to the list of functions that can be called at an indirect call site. Calculation of this metric leads to an increase in analysis time and so the +metrics option does not emit Indirect Call Targets by default. You need to specify ict as a suboption to the +metrics option for emission of indirect call targets. This causes emission of Indirect Call Targets in addition to all other default metrics.

The following example shows the code complexity metrics.

2.7 Generating code complexity metrics 15

Page 15
Image 15
HP UX Web Development Tools manual Generating code complexity metrics