ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Code Improvement Through Cyclomatic Complexity
Subject:   Too restrictive.
Date:   2004-11-19 13:22:50
From:   glenpepicelli

Very interesting article.

However, I oppose using the counts as a metric.

I happen to be writing a chess now (in java). It has tables implemented as 64 way switch statements. These obviously give a count of 64, but can you really say they are too complex? For example one takes one of 64 chess squares as an argument and returns a board with 2 to 8 squares where a knight can jump to. I know there are no bugs in the method because I printed out all 64 possible cases and checked them by hand.

So while the concept is very interesting I think there are exceptions where you don't want to just count all all the decidsion points.

Glen Pepicelli