


To put it differently it’s generally considered in the context of a maintainability index. In essence it’s the different number of routes through a piece of logic. Cyclomatic complexity may also be applied to individual functions, modules, methods or classes within a program. Cyclomatic complexity is computed using the control flow graph of the program: the nodes of the graph correspond to indivisible groups of commands of a program, and a directed edge connects two nodes if the second command might be executed immediately after the first command. It is a quantitative measure of the number of linearly independent paths through a program’s source code. Well this is where cyclomatic complexity enters the frame.Ĭyclomatic complexity is a software metric, used to indicate the complexity of a program.

We all know to keep our code “ Simple” We’ve all heard about the KISS principle, but were we ever told what simple really was, and how we should measure it? I feel it’s a very valuable tool in a developer’s arsenal, and something that should be used in code reviews and for the maintainability of your codebase. Having read about it a few years ago, it apparent use seems to have deteriorated. Cyclomatic what? Even spell check doesn’t recognise the word, but it’s a super useful software metric for understanding how your software works.
