Friday 19 January 2018

Cyclomatic Complexity

Cyclomatic Complexity(Code Complexity) is a metric used to measure complexity of a program.
This metric was developed by Thomas McCabe in 1976.It measures the number of linearly independent paths through the programs code.
If the program's cyclomatic complexity is low , it will be easier to modify.

It can be defined by the following formula:

M = E - N + 2P

where,
     E - Number of Edges in the graph.
     N - Number of Nodes in the graph.
     P - Number of Connected Components.



No comments:

Post a Comment