By aglover
via thediscoblog.com
Published: Jan 07 2007 / 13:01
Recently, there have been a number of online discussions regarding code metrics and their associated value. There have been some excellent points made; however, I did notice an apparent misunderstanding when it comes to Cyclomatic complexity.



Comments
willcode4beer replied ago:
I don't think its really meaningless. It is very useful for finding problem code.
I was handed a 'problem' code base to maintain recently. Running metrics found a class with an excessively high cyclometric complexity. Viewing the class showed a single method that was over 3 thousand lines long. Code was copy/pasted into several gigantic if/elseif/elseif/.../else blocks.
I thought it was very useful to find the places where refactoring was desperately needed.
aglover replied ago:
But as you saw, the class had a method with a high CCN. In my opinion, the value of the metric is only meaningful in the context of a method.
Voters For This Link (9)
Voters Against This Link (0)