Skip to main content

Module bands

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_trend for architectural, code, and combined health.
  • Structural risk (0–1, higher = worse): used by code_health for the structural_risk biomarker 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_MIN receive band = "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_MIN receive band = "yellow"; files below RISK_YELLOW_MIN receive band = "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.