Interpreting Metrics Results

July 29, 2026 ยท View on GitHub

This guide explains what each metric means and how to interpret the values in your evaluation results.

Line Count Metrics

Basic code size measurements computed using Radon.

MetricDescriptionInterpretation
total_linesTotal lines in file including blanksRaw file size
locSource lines of codeActual code (excludes blanks)
commentsTotal comment linesDocumentation coverage
single_commentSingle-line comments (#)Inline documentation
multi_commentMulti-line comment linesBlock documentation

Lint Metrics

Code quality issues detected by Ruff.

MetricDescriptionInterpretation
lint_errorsTotal violations foundLower is better
lint_fixableAuto-fixable violationsCan be fixed with ruff --fix
countsViolations by rule codeIdentifies specific issues

Common Ruff rule prefixes:

  • E: pycodestyle errors (style issues)
  • W: pycodestyle warnings
  • F: pyflakes (logical errors, unused imports)
  • I: isort (import ordering)
  • B: flake8-bugbear (likely bugs)

Complexity Metrics

Measures code complexity using cyclomatic complexity (CC) and maintainability index (MI).

Cyclomatic Complexity (CC)

CC counts the number of independent paths through code. Each decision point (if, for, while, and, or, except) adds 1.

Rating Scale (Radon standard):

RatingCC RangeInterpretation
A1-5Simple, low risk
B6-10Moderate complexity
C11-20Complex, moderate risk
D21-30Very complex, high risk
E31-40Highly complex
F41+Untestable, very high risk

Key metrics:

MetricDescription
cc_maxHighest CC in any function
cc_meanAverage CC across functions
cc_stdStandard deviation of CC
cc_high_countFunctions with CC > 10
cc_extreme_countFunctions with CC > 30
cc_concentrationHow unevenly complexity is distributed

What to look for:

  • cc_max > 20: Consider refactoring the most complex function
  • cc_high_count > 0: Review functions with CC > 10
  • High cc_concentration: Complexity concentrated in few functions

Maintainability Index (MI)

MI is a composite score (0-100) based on LOC, CC, and Halstead metrics.

RatingMI RangeInterpretation
A>= 19Highly maintainable
B10-19Moderately maintainable
C< 10Difficult to maintain

Key metrics:

MetricDescription
mi_minLowest MI (worst file)
mi_sumSum of MI across files
mi_ratingsDistribution of A/B/C ratings

Function Statistics

Aggregated statistics across all functions and methods.

MetricDescriptionThreshold
nesting_meanAverage max nesting depth> 3 is concerning
nesting_high_countFunctions with deep nestingShould be minimized
comparisons_meanAverage comparison operatorsHigh values indicate complex logic
branches_meanAverage branch pointsHigh values indicate decision-heavy code
control_meanAverage control blocksHigh values indicate complex flow
lines_meanAverage lines per functionLong functions may need splitting

Concentration metrics (e.g., nesting_concentration) measure how unevenly a metric is distributed. High concentration means a few functions dominate.

Class Statistics

MetricDescription
countTotal number of classes
method_counts_meanAverage methods per class
attribute_counts_meanAverage attributes per class

Waste Metrics

Detects potential over-abstraction or unnecessary indirection.

MetricDescriptionWhy It Matters
single_use_functionsFunctions called only onceMay be premature abstraction
trivial_wrappersFunctions that just call another functionUnnecessary indirection
single_method_classesClasses with only one methodMay not need to be a class

Interpretation:

  • Some single-use functions are fine (e.g., for readability)
  • Trivial wrappers add cognitive overhead without benefit
  • Single-method classes might be better as functions

Clone Metrics

Clone coverage comes exclusively from the pinned scb-check report.

MetricDescription
cloned_sloc_linesSource lines covered by clones
cloned_pctClone LOC divided by total LOC

Interpretation:

  • High cloned_pct suggests refactoring opportunities
  • Duplicates often indicate missing abstractions

Graph Metrics

Dependency analysis based on import relationships (Python only).

MetricDescriptionInterpretation
node_countFiles/modules in graphCodebase size
edge_countImport relationshipsCoupling indicator
cyclic_dependency_massRatio of edges in cycles0 = no cycles, 1 = all cyclic
propagation_costAverage reachabilityHow changes propagate
dependency_entropyNormalized Shannon entropyEvenness of dependencies

What to look for:

  • cyclic_dependency_mass > 0: Has circular dependencies (problematic)
  • High propagation_cost: Changes affect many modules
  • Low dependency_entropy: Uneven dependency distribution (some modules are hubs)

Delta Metrics

Percentage changes between consecutive checkpoints.

MetricDescriptionFormula
delta.locLOC change(curr - prev) / prev * 100
delta.verbosityscb-check verbosity changeSame formula
delta.churn_ratioCode churn(added + removed) / prev_total

Interpretation:

  • Positive delta: Metric increased (often worse)
  • Negative delta: Metric decreased (often better)
  • inf: Previous value was 0, now non-zero
  • 0: No change

Composite Summary Scores

High-level scores reported by the pinned scb-check release and aggregated across checkpoints.

Verbosity Score

Measures code bloat and over-abstraction. Lower is better.

Erosion Score

Measures structural degradation. Lower is better. scb_check_version records the exact checker release used for the checkpoint scores.

Summary: What Good Code Looks Like

Target metrics for high-quality submissions:

CategoryGoodConcerning
CC ratingsMostly A/BMultiple D/E/F
cc_max< 15> 30
lint_errors0> 10
verbosityLower relative to comparable runsHigher relative to comparable runs
cloned_pct< 5%> 15%
trivial_wrappers0> 3
cyclic_dependency_mass0> 0.1

Remember: Context matters. Some complex functions are unavoidable, and metrics are guidelines, not absolute rules.