Skip to content

Rank & compare entities by a metric

"Which function has the highest complexity?" "Which file has the worst coverage?" Any single metric answers this once you can see many entities side by side, ordered by it. Understand offers a few ways to do that — which one fits depends on how many entities you're comparing and whether you want an in-GUI answer or a file you can sort, chart, or archive.

Some metrics are slower to compute than others

Built-in line/statement metrics (CountLine and friends) and Cyclomatic Complexity (and its family) are calculated during analysis and stored, so reading or ranking by them is fast regardless of how many entities you're comparing. Most other metrics — plugin metrics, and a few built-ins like CountClassCoupled — are calculated on demand, one entity at a time, and can get slow across a whole project; use a …Batch variant where one exists (e.g. CountClassCoupledBatch) to pre-compute every entity's value once instead. Architecture-level metrics are always calculated on demand, since they're aggregated from the architecture's contents each time — expect any of the four methods below to take longer at the architecture level.

Add a column in the Entity Locator

For a quick, in-GUI ranking: open the Entity Locator (View → Entity Locator, or Search → Find Entity), add the metric you care about as a column, and click the column header to sort. See Find things fast for the full Entity Locator walkthrough.

Export to CSV or HTML and sort externally

For a full project sweep, a shareable file, or scripting: export the metrics you want and sort in a spreadsheet (or Cyclomatic descending in a CSV viewer, say, to get your worst offenders first). See Export & track metrics over time for the GUI export dialog and the und metrics CLI equivalent.

Visualize two metrics at once: Treemap & Heatmap

To see size and complexity together across the whole project rather than reading a table, use the Metrics Treemap (box size and colour each mapped to a metric you choose) or the Metrics Heatmap (flags entities that cross a risk threshold on several metrics at once). Both are project-wide and visual, rather than a sortable list. See Where is my risky / complex code? for the full walkthrough of both.

Chart or histogram a metric as a graph

Understand also ships a family of Metric Chart and Metric Histogram graph plugins — one pair per level (Architecture, Classes, Files, Functions; no histogram variant for architectures). Right-click a project or architecture → Graphical Views to find them (enable them first from the Plugin Manager if they're not listed):

Graph Shows
Architecture Metric Chart The architecture's groups as nodes, sized and coloured by two metrics you pick.
Classes Metric Chart / Histogram Classes sized/coloured by two metrics, or a distribution histogram of one.
Files Metric Chart / Histogram Files sized/coloured by two metrics, or a distribution histogram of one.
Functions Metric Chart / Histogram Functions sized/coloured by two metrics, or a distribution histogram of one.

The Chart variants pick a size metric and a color metric, like the Metrics Treemap, but for one entity kind at a time and with a choice of layout:

  • Treemap — the same idea as the built-in Metrics Treemap, but launched on a specific architecture (right-click it → Graphical Views) so you can narrow the result to just that subtree — e.g. just the source folder — instead of the whole project.
  • Sunburst (architectures only) — nests by directory structure, like the Home dashboard's Directory Structure card, but with any size and color metric instead of the fixed ones there.
  • Flat Bubble — an unnested, ranked list of the top entities by the size metric (set how many with the Maximum Nodes Shown option) — the same idea as the Home dashboard's Most Complex Functions/Classes/Files cards, but for any metric, entity kind, and count.
  • Pie — proportional share of the size metric.

The Histogram variants default to CountLine if you don't pick a metric.

Where to next