Managed Code Analysis and Code Complexity


One of the coolest features of the Developer edition of Team System is integrated code analysis. That's a fancy way of saying that Microsoft has fully integrated FxCop into the IDE and build process. You can even establish checkin policies that require code analysis.

To get an idea of what's available on the code analysis "menu", I highly recommend paging through Microsoft's Code Analysis for Managed Code Warnings on MSDN:
Here's why it's a good idea to read through these at least once. One of the real analysis gems is hidden in there under the Maintainability category -- rule CA1502: Avoid excessive compexity.



The documentation page for the rule confirms this is a warning based on cyclomatic complexity, a classic computer science measure of function complexity. Unfortunately, the limits are hard-coded, which is too bad:

25Warning
50 Critical Warning
75Error
100Critical Error

That's awfully generous, considering that some people consider anything with a cyclomatic complexity over 40 a complete failure!

posted on Tuesday, February 28, 2006 12:06 PM by jatwood

Comments

# Code complexity greater than ten raises my eyebrows.

Tuesday, February 28, 2006 3:17 PM by notgartner.com: Mitch Denny's Blog

# VSTS Links - 03/02/2006

Rob Caron blogs on viewing all team project portal sites. He also wants you to celebrate the launch...
Thursday, March 02, 2006 6:06 AM by Team System News

# Code complexity greater than ten raises my eyebrows.

I was reading this post about managed code analysis and code complexity over at the Vertigo Software
Sunday, July 16, 2006 7:59 AM by Community Blogs

# Visual Studio 2005 Team Edition for (unmanaged) C++ Developers


If you're a C++ developer who writes mostly unmanaged C++ code, you may wonder what parts of Visual...
Friday, September 29, 2006 6:09 PM by Team System