Skip to content

Halstead analyzer reference

The Halstead analyzer computes Halstead complexity metrics (1977) based on operator and operand counts extracted from the UAST.

For the conceptual model — what operators and operands are and which derived metrics matter most — see Understanding Halstead metrics. To run it, see the Quick start.


Configuration options

The Halstead analyzer uses the UAST directly and has no analyzer-specific configuration options.

Option Type Default Description
(none) -- -- Uses UAST; no analyzer-specific config

Output formats

Terminal (text/summary)

The section surfaces foundational counts before derived metrics:

  • Distinct Operators (n1)
  • Distinct Operands (n2)
  • Total Operators (N1)
  • Total Operands (N2)
  • Vocabulary, Volume, Difficulty, Effort, Est. Bugs

Top issues include compact multi-signal context:

  • effort=<...> | vol=<...> | bugs=<...>

Severity is determined from both effort and bug estimate.

Plot

The plot report includes:

  1. Top Functions by Effort (Top 12, highest first)
  2. Volume vs Difficulty risk map:
  3. X: volume
  4. Y: difficulty
  5. bubble size: estimated bugs
  6. color: low/medium/high risk bucket
  7. Volume Distribution by bucket (Low, Medium, High, Very High)

See also