Calculate · Assess & Decide · Engineering
Maintainability index per module
The Maintainability Index (raw and 0-100 normalized) per module from Halstead volume, cyclomatic complexity, and lines of code, with a maintainability band.
You receive: A reviewed maintainability-index calculator + the passing test report, run on your module metrics.
Part of Ship MVP
What's verified: STUD verifies the calculator computes the Maintainability Index per module on held-out cases: MI_raw = 171 - 5.2*ln(Halstead volume) - 0.23*complexity - 16.2*ln(lines of code), the 0-100 normalization clamped at zero, and the band from your cutoffs (volume and lines must be positive). STUD does NOT compute Halstead volume or complexity from real code, nor decide whether a band means a module is genuinely maintainable; it checks the formula on the metrics you provide.
Opens soon
This play is verified and ready. It opens soon, once sign-in and payments are live.
Example
A sample of what this play produces. Your result is generated for your inputs.
Band thresholds
Rows
| Name | Mi raw | Mi 100 | Band |
|---|---|---|---|
| facts-store.ts | 49.66 | 29.04 | good |
| lenses.ts | 21.6 | 12.63 | moderate |
| tasks.py | -99.08 | 0 | low |
Inputs
| Name | Halstead volume | Cyclomatic complexity | Loc |
|---|---|---|---|
| facts-store.ts | 900 | 8 | 180 |
| lenses.ts | 3000 | 18 | 600 |
| tasks.py | 250000 | 180 | 25000 |
Arithmetic recomputed against the judge tasks.py _mi_reference oracle, 2026-08-08: per module, MI_raw = 171 - 5.2*ln(halstead_volume) - 0.23*cyclomatic_complexity - 16.2*ln(loc), and MI_100 = max(0, MI_raw*100/171). facts-store.ts: 171 - 5.2*ln(900) - 0.23*8 - 16.2*ln(180) = 49.66 raw, 29.04 on the 0-100 scale, band good (at or above the good_min of 20). lenses.ts: 21.6 raw, 12.63, band moderate (between 10 and 20). The tasks.py module: -99.08 raw, clamped to 0 on the 0-100 scale, band low. The module metrics are illustrative readings over modules in STUD's own codebase; the play checks the formula on the metrics you provide, it does not measure Halstead volume or complexity from your code.
Get early access to STUD the day it goes live.