The Cyclomatic Complexity calculator computes a complexity factor based on the number of edges, nodes, and exit nodes.
INSTRUCTIONS: Enter the following:
Cyclomatic Complexity (CC): The calculator returns the factor as a real number.
The Cyclomatic Complexity estimation technique is used to compute the complexity of a program, algorithm, function, module, method, or class by computing the number of linearly independent paths through the code. The computation of the cyclomatic complexity is abstracted from the control flow graph of the program. The nodes of the graph correspond to functionally indivisible code blocks and edges connect two nodes when successive blocks must execute one after the other.
The formula for Cyclomatic Complexity is:
CC = E - N + 2 * P
where: