Posted by & filed under Documentation.

Metrics have always been very tightly coupled with software engineering. Love them or hate them, there is usually no avoiding them. In Understand 2.0 we’ve significantly increased our ability to provide useful metrics about your project. 

The metrics capabilities vary depending on what version of Understand you are using: Understand Engineer provides high level project metrics, Understand Pro lets you explore and export project and entity level metrics, and Understand Analyst lets you do all that, create custom graphs, and even compare how metrics are changing over time (trend analysis). 

All of this Metrics capability is accessed through the new Metrics menu.

Engineer

Pro

Analyst
image image image

Basic and Advanced Metrics

We’ve noticed that some basic metrics are more useful to engineers then others, such as number of lines of code, number of classes etc. while other metrics are usually more helpful for management and code analysis. Since Understand Engineer and Pro target programmers, these Basic metrics are available in all versions, while the advanced metrics are partially available in Pro and fully available in Analyst.  Though which metrics are displayed depends on what languages are being analyzed, here is a list of what you can expect:

Basic Metrics Advanced Metrics (Partial list)
  • Class Count
  • File Count
  • Function Count
  • Line Count
  • Blank Line Count
  • Code Line Count
  • Comment Line Count
  • Inactive Line Count
  • Declarative Statement Count
  • Executable Statement Count
  • Ratio Comment to Code
  • Cyclomatic Complexity
  • Knots
  • Class Coupling
  • Percent Lack of Cohesion
  • Path Count
  • Max Inheritance
  • Base Class Count
  • Inherited Class Count
  • Number of Instance Methods
  • Weighted Methods per Class

For a full list see this list.

Understand Engineer

Metrics Summary

The metrics summary provides an overview of the basic project metrics. For example I can quickly see how large my codebase is or how well I do at commenting my code. If there are snapshots in the project, you can also view the same metrics for those snapshots. 

image
image

 

Code Volume Graph

File Volume Graph

image image
This graph gives a quick view of what percentage of the source is executable code, declarative code, comments, and blank lines. And this provides an overview of how many files are in your project and their breakout.

Understand Pro

Metrics Browser

The metrics browser is an efficient way to access all of your available metrics. With the metrics browser you quickly see the high level project overview metrics from Understand Engineer. You can also drill down through your file structure or other architectures to quickly see the basic metrics for any subset of your code. For example, in this case I can quickly see how many lines of code Mark owns and the breakout of that code.

If I drill down to the file level, I can actually get the Advanced metrics for any particular file I’m interested in as well.

imageimage

 

 

Export Metrics

Understand Pro let’s you select and export metrics to csv files, which you can then slice and dice with your favorite spreadsheet editor. The metrics you select are exported for files and all Major Language Elements e.g. class, function, methods, structs etc.

image

  image

 

Average Complexity

Sum Complexity

< a href="/wp-content/uploads/mt-old/WindowsLiveWriter/MetricsGalore_A26B/image_27.png">image image
This graph shows how complex your code is on average using the cyclomatic complexity metric and also how deeply nested your code is. And this shows the total number of paths through your code, the cumulative cyclomatic complexity, and essential complexity.

Understand Analyst

Metrics Browser

In addition to the Metrics Browser functionality in Understand Pro, Understand Analyst provides Advanced metrics for any level of an Architecture tree, so if I wanted to know the average complexity of Mark’s code, that information is right there.

image

Export to HTML

The entire set of Advanced Metrics in the Metrics Browser can be exported to HTML using Analyst. This report is perfect for posting on the team intranet and provides quick access to a very wide range of information.

 image

Browse Metrics Graphs

This feature is where Understand Analyst really shows its strength as a premium metrics tool. This window gives you the capability to generate an unlimited number of metrics graphs.

There are two major report categories here, Project metrics and Change Metrics. Project metrics are based on the snapshot you are looking at. Change metrics let you see how those project metrics have changed between different points in time. For example I can graph how many lines of code each engineer owns in my current database using project metrics. Using the change metrics I can see how many lines of code each engineer added, changed and removed since the last build.

image

The examples below are just a few reports generated almost instantly using Understand Analyst.

image
Code volume by Staff – Go Mark!
image
Code Breakdown by Language 
image
Classes Modified between builds by Staff
image
Files Changed between builds by staff