Skip to content

What metrics does Understand have?

Understand computes a large catalog of metrics for every entity it parses — over 270, including aggregates and per-language variants. Rather than list them all here, this page explains how they're organized and where to find the authoritative, per-metric definitions.

Understand is metric-agnostic

Understand reports the numbers; it does not tell you your code is "good" or "bad", and it does not prescribe pass/fail thresholds. Your team decides what the values mean. See Interpret key metrics for when-to-worry guidance, and HIS metrics / CodeCheck when you need threshold-based gating.

The categories

Understand groups metrics into a few families:

Category Measures Representative IDs
Lines & statements (size / volume) How much code there is CountLine (physical lines), CountLineCode (LOC/SLOC), CountLineComment, CountLineBlank, CountStmt, CountStmtDecl, CountStmtExe
Complexity How tangled the control flow is Cyclomatic (+ Modified/Strict/Essential variants), CountPath, MaxNesting, Knots, RatioCommentToCode
Object-oriented Class design, coupling, cohesion CountClassCoupled (CBO), MaxInheritanceTree (DIT), CountClassDerived (NOC), CountDeclMethodAll (RFC), CountDeclMethod (WMC), PercentLackOfCohesion (LCOM)
Counts (project & architecture) How many of each thing CountDeclFile, CountDeclClass, CountDeclFunction, CountDeclMethod, CountDeclInstanceVariable, CountInput/CountOutput (per-entity fan-in/fan-out — for the per-file kind see coupling & cohesion)

Most base metrics also have aggregate variants that roll a function-level number up to its class, file, or the whole project: Sum…, Avg…, and Max… (for example SumCyclomatic, AvgCyclomatic, MaxCyclomatic).

For the coupling and cohesion metrics in depth — including the fan-in/out plugin metrics — see Measure coupling & cohesion; for using violations and complexity as a debt proxy, see Measure & track technical debt.

Many metrics are hidden by default

As the catalog has grown, several metrics and variants are disabled/hidden out of the box to keep the GUI uncluttered. Manage which metrics are visible with Metrics → Configure Metrics. A disabled/hidden metric is still accessible from the command line and API.

Use plugin manager groups

The category and aggregation information isn't only a documentation convention. They are filters in the Plugin Manager that you can use when configuring metrics.

The cost

Another useful metric grouping is the cost. There are four cost levels:

Cost Calculation Representative IDs
Lookup stored during project analysis CountLine (physical lines), Cyclomatic
Query on demand with a simple calculation CountClassDerived (NOC), CountDeclMethodAll (RFC)
Cached slow for first call that builds a cache, and fast lookups after CountClassCoupledBatch, GitAuthors
Slow on demand with a complex calculation CountClassCoupled, CognitiveComplexity

The cost levels are for the most common target, usually an entity. For example, Cyclomatic is a lookup for a function, and CountClassDerived is a query for a class. A "Slow" cost is rarely a problem for one entity at a time in the Metrics Browser — it's usually only problematic when calculating across many entities at once: when ranking by metric, exporting metrics for an entire project, or aggregating up to an architecture.

The full catalog

For the complete, always-current list — every metric's API ID, friendly name, calculation, and the languages it applies to — see the metrics catalog. Not every metric applies to every language or entity; the Metrics Browser shows only the metrics valid for whatever you select.

Where metrics show up

Once analyzed, the same numbers surface throughout Understand:

Extending the catalog

You're not limited to the built-ins. Understand ships Python-API metric plugins (Halstead, cognitive complexity, LCOM4, code coverage, Git churn, …), and you can write your own — see Write a metric plugin. Most Python-API metric plugins are disabled/hidden by default, and are turned on the same way built-in metrics are with Metrics → Configure Metrics.