Cyclomatic Complexity

Turkish equivalent: Döngüsel karmaşıklıkDomain: Software Engineering

A structural code metric derived from the control-flow graph and related to the number of linearly independent execution paths.

Cyclomatic Complexity is not a standalone code-quality score. It measures control-flow structure, not developer skill or business difficulty.

For a connected control-flow graph, the classic form is M = E - N + 2. Tooling may differ in how compound predicates and multiple exits are counted, so values from different analyzers are not automatically interchangeable.

Practical Use

A high value can be a useful signal for branching test effort, review cost, and change risk. Fixed thresholds are more informative when combined with method size, nesting, cognitive complexity, and actual defect history.

Source

  • https://doi.org/10.1109/TSE.1976.233837