VS 2005 introduced internal static analysis tools. This helps you to write secure and quality code.

Visual Studio 2008 has new Code Analysis features:

  • Code Metrics – This gives you the ability to dig deep to find those un-maintainable and complex hotspots. Code Metrics will ship with five metrics – Cyclomatic Complexity, Depth of Inheritance, Class Coupling, Lines of Code and Maintainability Index.
  • Analysis improvements:
    • Support for analyzing anonymous methods and lambda expressions
    • Reduced noise in existing analysis and the ability to skip over tool generated code
    • New analysis, including additional rules around security, globalization, maintainability and spelling.

To generate code metrics, simply do the following:In Solution Explorer, right-click on your solution/project and choose Generate Code Metrics

runCM

After generation you’ll get the Code Metrics Results window and a tooltip on every column that explain the result. The Maintainability Index column includes a maintainability indicator light that changes based on the maintainability of the code. Green indicates good maintainability, yellow indicates moderate maintainability, and red indicates poor maintainability.

cmResults

Technorati Tags: ,

Similar Posts:

Tags: , , ,



3 Comments to “Code Analysis in VS 2008”

  1. Maor David-Pur | June 22nd, 2009 at 23:12

    This comment originally written by:
    VS 2005 introduced internal static analysis tools. This helps you to write secure and quality code. Visual Studio 2008 has new Code Analysis features: Code Metrics – This gives you the ability to dig deep to find those un-maintainable and complex hotspots

  2. Maor David-Pur | June 22nd, 2009 at 23:12

    This comment originally written by:Duane Fields

    For those who don't have the Team System, Exact Magic Software has a free add in to Visual Studio called "Studio Tools" that has Code Metrics built in as well. It's pretty much the same thing as the one in the Team Edition. You can download it from http://www.exactmagic.com

  3. Maor David-Pur | June 22nd, 2009 at 23:12

    This comment originally written by:savitha

    Want Details about the Code analysis and Code metric

Leave a Comment