Wednesday, August 24, 2005

Cyclomatic Complexity

Cyclomatic Complexity helps to find the complexity of code. Cyclomatic Complexity verification has been added in latest version of FxCop. I found this feature of great help while doing code review with the help of FxCop.

This is good article on Code Review and Complexity by Michael Swanson (Senior Consultant,Microsoft Corporation). This article also explains the advantages of McCabe's Cyclomatic Complexity as:


  • It is very easy to compute
  • Unlike other complexity measurements, it can be computed immediately in the development lifecycle (which makes it Agile-friendly)
  • It provides a good indicator of the ease of code maintenance
  • It can help focus testing efforts
  • It makes it easy to find complex code for formal review




This is a good presentation on Taming the Software
Development Process
by Michael Swanson (Senior Consultant,Microsoft Corporation). This presentation also explains the cyclomatic complexity and its advantages.

No comments: