Imagix 4D User Guide


Function Metrics

The following metrics are generated for functions (methods) in the project source code. For library functions (those functions in the source code for which there is no definition), only the fan-in metrics apply.

Size Metrics

Lines in FunctionNumber of lines in the function.
Lines of Source CodeNumber of lines of statements in the function.
Variables in FunctionNumber of parameters and locals variables in the function.
To be accurate (non-zero), data must be collected with the -locals option enabled.

McCabe Complexity Metrics

McCabe Cyclomatic CmplxCyclomatic complexity of the function (McCabe v(G)). This represents the number of decision points in the function. It also represents the number of linearly independent test paths through the function. Users may also select alternative calculations of cyclomatic complexity, either Myers' 1979 Extension counting predicates within decisions, or the Modified definition counting parallel cases as a single decision.
McCabe Decision DensityDecision density (cyclomatic density) of a function. Calculated as the ratio of the cyclomatic complexity to the lines of statements for the function.
McCabe Essential CmplxEssential complexity of the function (McCabe ev(G)). This represents the number of decision points in the function which contain unstructured constructs.
McCabe Essential DensityEssential density, or degree of unstructuredness, of a function. Calculated as the ratio of the essential complexity to the cyclomatic complexity.

Other Complexity Metrics

Decision Depth in FunctionNumber of nested levels of decisions or control statements within the function.
Halstead Intelligent ContentLanguage-independent measure of the amount of content (complexity) of the function (Halstead I).
Halstead Mental EffortMeasure of the number of elemental mental discriminations necessary to create, or understand, the function (Halstead E).
Halstead Program VolumeMeasure of the information content of the function (Halstead V).
Halstead Program DifficultyMeasure of how compactly the function implements its algorithms (Halstead D). This is the inverse of the Halstead Program Level (of abstraction).
KnotsMeasure of the complexity and unstructuredness of the function (Woodward, Hennell and Hedley knot).

Control Flow Metrics

Fan In of Function CallsNumber of functions in the source files loaded into the project which call or read the function, either directly or through function pointers.
Fan Out of Function CallsNumber of functions which are called or read by the function, either directly or through function pointers.
Global Variables UsedNumber of global variables set and/or read by the function.
Static Variables UsedNumber of static variables set and/or read by the function.
Transitive Fan In of FuncsNumber of functions in the source files loaded into the project which transitively call or read the function, including calls through function pointers.
Transitive Fan Out of FuncsNumber of functions which are transitively called or read by the function, including calls through function pointers.

Profile Metrics

All profile metrics require that appropriate profile data be loaded.
CoveragePercentage of blocks of code that were executed.
FrequencyNumber of times the function was called during execution.
TimeTime spent executing the function.