Cyclomatic complexity
I came across this interesting metric called "Cyclomatic complexity" at work today. It is measurement of how complex a function is in terms of the logical branches it has.
The formal definition as in Wikipedia is quite mathematical and not in tune with the thinking of the like minded people visiting my blog.
A far less and simple definition can be found at this code project article which says to calculate this metric:
• Start with 1 for a straight path through the routine. • Add 1 for each of the following keywords or their equivalent: if, while, repeat, for, and, .........
|
|