[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Collapse]CodeRush Classic
  What's New
 [Expand]System Requirements
 [Collapse]Concepts
  [Expand]Code Analysis
  [Expand]Code Style
   Feature Advisor
   FrictionFree Mode
   Mastering CodeRush Classic Features
  [Collapse]Visualization Tools
    Code Metrics
    CodeRush Classic Keyboard Mapping Window
    Debug Visualizer
    Debug Visualizer Toolbar
    DXCore Visualize Toolbar
    Flow Break Evaluation
    Region Painting
    Right Margin Line
    Spell Checker
    Structural Highlighting
    XML Doc Comment Painter
  [Expand]Navigation
  [Expand]Advanced Selection Tools
  [Expand]Clipboard Tools
  [Expand]Coding Assistance
   Unit Test Runner
 [Expand]Visual Elements
 [Expand]Tool Windows
 [Expand]CodeRush Classic Options
 [Expand]Examples
  Get More Help
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Code Metrics

Code Metrics enables you to evaluate code metrics right in the code editor while writing code. By default, a metric appears as a number to the left of a member declaration.

 

 

The following metrics are available.

Name Description
Cyclomatic Complexity Cyclomatic complexity is calculated using the number of different code paths in the flow of the program. A program with a complex control flow requires more tests to fully cover the code and is less maintainable.
Line Count The total number of lines that belong to a class member. A very high metric value indicates that a type or method is hard to maintain, and does too much work and should be split up.
Maintenance Complexity Every element of the code (local variable declarations, assignment statements, expressions in for loops, unary operator, etc.) has a weighted value. The maintenance complexity of a member is the total weighted value of all elements contained in or referenced from this member.

Use the Show Metrics options page to specify the shown metric and the way it appears. You can specify the shown metric via the drop-down menu as well. To call the menu, click a metric.

 

 

You can enable or disable Code Metrics from either the Show Metrics options page or from the CodeRush Classic toolbar.

Note

This product is designed for outdated versions of Visual Studio. Although Visual Studio 2015 is supported, consider using the CodeRush extension with Visual Studio 2015 or higher.

Is this topic helpful?​​​​​​​