How to: Generate Code Metrics Data

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

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.

See Also

Measuring Complexity and Maintainability of Managed Code