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: HalsteadVocabularyLanguages: Any
Targets: Files, Functions
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