Tuesday, October 11, 2011

Cyclomatic Complexity

Checkout here:
http://en.wikipedia.org/wiki/Cyclomatic_complexity
http://hissa.nist.gov/HHRFdata/Artifacts/ITLdoc/235/chapter2.htm
http://www.rkcole.com/articles/other/CodeMetrics-CCN.html

  1. add 1 for each if statement
  2. add 1 for each for statement
  3. add 1 for each while loop
  4. add 1 for each do-while loop
  5. add 1 for each && (an implied if statement)
  6. add 1 for each || (an implied if statement)
  7. add 1 for each ? (an implied if statement)
  8. add 1 for each . (an implied if statement)
  9. add 1 for each case statement
  10. add 1 for each default statement
  11. add 1 for each catch statement
  12. add 1 for each finaly statement
  13. add 1 for each continue statement

No comments: