Halstead Vocabulary (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 Vocabulary (n)
| API ID | HalsteadVocabulary |
| Targets | Files Functions |
| Languages | Any |
| Categories | Tokens |
| Cost | Slow |
| Suites | Halstead |
Halstead Vocabulary (n) is the sum of unique operators (n1) and unique operands (n2)
It's calculated as
- n1 = unique operators (HalsteadDistinctOperators)
- n2 = unique operands (HalsteadDistinctOperands)
- n = n1 + n2
See all Halstead metrics.