scitools.com

← Metric catalog

Max Strict Cyclomatic Complexity is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Max Strict Cyclomatic Complexity

API ID: MaxCyclomaticStrict
Languages: Ada, C#, C++, Fortran, Java, Jovial, Pascal, Python, Rust, Web
Targets: Architectures, Classes, Files, Modules, Packages, Project

Maximum strict cyclomatic complexity of nested functions or methods.

For example:


class SayHello {
public:
  SayHello() {}
  void printHello();
};

void SayHello::printHello() {
  switch (i) {
    ...
  }
}

void cyclomaticDemo() {
  ...
}

int func();          // declared here, not defined - excluded from aggregates

int main() {
  ...
}

SayHello(), printHello(), cyclomaticDemo(), and main() have Strict Cyclomatic Complexity of 1, 4, 12, and 2. func() is only declared, not defined, so it isn't counted. For the SayHello class, the maximum is 4. For the whole file (sample.cpp), the maximum is 12.

See Sum and Average Strict Cyclomatic Complexity for the other aggregations.


Targets By Language: Configuration: