Cyclomatic Complexity

Cyclomatic complexity is a software metric developed by Thomas J. McCabe, Sr. in 1976 to measure the complexity of a program. It quantitatively measures the number of linearly independent paths through a program’s source code. The complexity is computed using the program’s control-flow graph, which consists of nodes representing groups of commands and directed edges representing the flow of execution. Cyclomatic complexity can be applied to individual functions, modules, methods, or classes within a program. It is often used in testing strategies to determine the number of test cases needed. The higher the cyclomatic complexity, the more pathways through the code need to be tested.

https://en.wikipedia.org/wiki/Cyclomatic_complexity

To top