Halstead Maintainability Index 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 Maintainability Index
API ID: HalsteadMaintainIdxLanguages: Any
Targets: Files, Functions
Original Halstead Maintainability Index
This metric measures how easy it is to maintain and change code. It is calculated using the Halstead Volume metric, Cyclomatic Complexity and Lines of Code (SLOC).
The higher the metric the easier the code is to maintain.
Maintainability Index = 171
- 5.2 * ln(HalsteadVol)
- 0.23 * CyclomaticStrict
- 16.2 * ln(CountLineCode)
+ 50 * sqrt(2.46 * RatioCommentToCode)
Treemap with red functions being the hardest to maintain