June 2007 Entries
Cyclomatic Complexity and FXCop

I am a big believer in ‘Simple is Better’. Having built-in cyclomatic complexity metrics displayed in the IDE while you are coding or reviewing code is awesome.  I use an IDE add-in tool called CodeRush but you can review DevMetrics as well.  Dennis Bottjer introduced me to another tool called nDepend that measures cyclomatic complexity as well as other statistics.

Learn more about cyclomatic complexity here -

I imagine many Enterprise developer groups struggle with decreasing budgets and timelines while trying to maintain, integrate, test and review code.  Today, you not only have the challenge of maintaining code quality with developers in the States but the problem exasperates if you employ overseas developers.  Automating your build, assemble and deployment process is critical to maintaining as well as improving the quality of your code.

My group practices Continuous Integration using CruiseControl.Net to improve the quality of our code.  We have only used CruiseControl.Net for a year and it has made a big difference. 

CruiseControl.Net is one of the best non-commercial Continuous Integration tools.  CruiseControl.Net not only automates the build process but integrates well with nUnit, MSBuild, nAnt, nCover, Simian and Fitnesse.  CruiseControl.Net also integrates with FXCop.

Our plan to measure and improve code quality is to introduce code analysis and testing tools into the build process.  One approach is to measure the cyclomatic complexity level and fail the build if the complexity level is too high.  I understand Visual Studio Team Edition includes a Continuous Integration solution as well as measuring cyclomatic complexity out of the box.

I came across a post by Dennis Forbes that describes using a custom FXCop rule to measure cyclomatic complexity.

posted @ Saturday, June 23, 2007 4:03 PM | Feedback (42)
Windows Live Writer Beta available


posted @ Sunday, June 10, 2007 12:19 AM | Feedback (53)