V(g) or Cyclomatic Number

Static Metrics for C, C++ and Ada

The V(g) or cyclomatic number is a measure of the complexity of a function which is correlated with difficulty in testing. The standard value is between 1 and 10.

A value of 1 means the code has no branching.

A function's cyclomatic complexity should not exceed 10.

The Metrics Viewer presents V(g) of a function in the Metrics tab when the corresponding tree node is selected.

When the type of the selected node is a source file or a class, the sum of the V(g) of the contained function, the mean, the maximum and the standard deviation are calculated.

At the Root level, the same statistical treatment is provided for every function in any source file.

Related Topics

Viewing Static MetricsHalstead Metrics