Module bands
Expand description
Shared health and risk band constants used across analyses and the SPA.
All band thresholds live here so a single edit propagates to every
consumer: health_trend, code_health, delta_health, the SPA JSON
payload (SpaOptionsSnapshot), and the JavaScript band helpers.
Two independent scales:
- Health score (0–100, higher = healthier): used by
health_trendfor architectural, code, and combined health. - Structural risk (0–1, higher = worse): used by
code_healthfor thestructural_riskbiomarker aggregate.
The two scales are numerically unrelated — do NOT conflate them.
Constants§
- HEALTH_
GREEN_ MIN - Minimum score (inclusive) for the green (healthy) health band.
Scores in the range
[HEALTH_GREEN_MIN, 100]map to"green". - HEALTH_
YELLOW_ MIN - Minimum score (inclusive) for the yellow (at-risk) health band.
Scores in the range
[HEALTH_YELLOW_MIN, HEALTH_GREEN_MIN)map to"yellow"; scores below this threshold map to"red". - RISK_
RED_ MIN - Structural risk threshold above which a file is in the red band.
Files with
structural_risk >= RISK_RED_MINreceiveband = "red". - RISK_
YELLOW_ MIN - Structural risk threshold above which a file is in the yellow band.
Files with
RISK_YELLOW_MIN <= structural_risk < RISK_RED_MINreceiveband = "yellow"; files belowRISK_YELLOW_MINreceiveband = "green".
Functions§
- health_
band - Map a health score (0–100, higher = healthier) to its color band.
- risk_
band - Map a structural risk value (0–1, higher = riskier) to its color band.