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: HalsteadLengthLanguages: Any
Targets: Files, Functions
Halstead Length (N) is the sum of total operators (N1) and total operands (N2)
It's calculated as
- N1 = total operators (HalsteadTotalOperators)
- N2 = total operands (HalsteadTotalOperands)
- N = n1 + N2