How to: Generate Code Metrics Data

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at How to: Generate Code Metrics Data.

You can decide to generate code metrics results for either an entire solution or a selected project.

Requirements

Visual Studio Enterprise

To generate code metrics results for an entire solution

  • Click Analyze menu, and then click CalculateCode Metrics for Solution.

    - or -

  • In Solution Explorer, right-click the solution and then click CalculateCode Metrics.

    - or -

  • In the Code Metrics Results window, click the CalculateCode Metrics for Solution button.

    The results are generated and the Code Metrics Results window is displayed.

To generate code metrics results for one or more selected projects

  1. In Solution Explorer, select one or more projects.

  2. Click Analyze, and then click Generate Code Metrics for Selected Projects(s).

    - or -

    Right-click your selections and then click CalculateCode Metrics.

The results are generated and the Code Metrics Results window is displayed.

To view the results details

  • Expand the tree in the Hierarchy column.

Measuring Complexity and Maintainability of Managed Code

Show: