02 February 2007

Cyclomatic complexity

I find myself searching from time-to-time what are the standard 'thresholds' for what cyclomatic complexity means. I'll put the table here so that later I know where to find it.

CCType of procedure Risk
1--4 A simple procedure Low
5--10 A well structured and stable procedure Low
11--20 A more complex procedure Moderate
21--50 A complex procedure, alarming High
>50 An error-prone, extremely troublesome, untestable procedure Very high

You can read more about this metric here. An older version of an utility I wrote and use for estimating this metric is here