BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. HTML5 Canvas
  2. Ruby
  3. iPhone/iPad
  4. Spring Web Flow
  5. REST
  1. jQuery Selectors
  2. Spring Config.
  3. Java
  4. Ajax
  5. Java Concurrency

Link Details

Link 10564 thumbnail
User 194430 avatar

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.
  • 9
  • 0
  • 1938
  • 1

Comments

Add your comment
User 209464 avatar

willcode4beer replied ago:

0 votes Vote down Vote up Reply

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.

User 194430 avatar

aglover replied ago:

0 votes Vote down Vote up Reply

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.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (9)



Voters Against This Link (0)