scitools.com

← Metric catalog

Halstead Length (N) is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Halstead Length (N)

API ID: HalsteadLength
Languages: Any
Targets: Files, Functions

Halstead Length (N) is the sum of total operators (N1) and total operands (N2)

It's calculated as