Scoring Table
Complete reference for how Technical Debt Radar calculates debt scores and gate decisions.
Scoring Table
Every violation detected by Radar is assigned debt points. The sum of all points in a PR produces the debt delta score. If the score exceeds the gate threshold, the PR merge is blocked.
Gate Thresholds
| Metric | Default Threshold | Effect |
|---|---|---|
debt_delta_score | > 15 | Block merge |
debt_delta_score | > 8 | Warn (comment, no block) |
These thresholds are configurable in radar.yml under the gates section.
Violation Points (Additions)
Points added to the debt delta score when violations are found.
| Rule | Points | Category | Blocks? |
|---|---|---|---|
architecture_violation | 5 | Architecture | Yes |
circular_dependency | 10 | Architecture | Yes |
runtime_risk_critical | 8 | Runtime Risk | Yes (Critical) |
runtime_risk_warning | 3 | Runtime Risk | No |
performance_risk_critical | 8 | Performance | Yes (XL/XXL) |
performance_risk_warning | 3 | Performance | No |
reliability_critical | 5 | Reliability | Yes (Critical) |
reliability_warning | 3 | Reliability | No |
complexity_point | 1 | Maintainability | Configurable |
missing_tests | 3 | Maintainability | Configurable |
coverage_drop_per_pct | 2 | Maintainability | Configurable |
ai_concern | 2 | AI Advisory | Never |
Fix Credits (Deductions)
Points deducted from the debt delta score when violations are fixed in the same PR.
| Fix Type | Points | Description |
|---|---|---|
violation_fixed | -5 | Fixed any violation from the baseline |
runtime_risk_fixed | -8 | Fixed a runtime risk violation |
complexity_reduced | -1 | Reduced cyclomatic complexity per point |
reliability_fixed | -3 | Fixed a reliability issue |
Fix credits reward developers for cleaning up existing debt. A PR that introduces 8 points of new debt but fixes 10 points of old debt has a net score of -2 (passes the gate).
Score Calculation
debt_delta_score = sum(new_violation_points) + sum(fix_credits)
Example PR:
| Finding | Points |
|---|---|
| 1 architecture violation (new) | +5 |
| 1 unbounded findMany on XL table (new) | +8 |
| 2 complexity increases of 3 points each (new) | +6 |
| Fixed 1 old runtime risk | -8 |
| Fixed 1 old reliability issue | -3 |
| Total debt_delta_score | 8 |
Result: Score of 8 is above the warn threshold (8) but not above the block threshold (15). PR gets a warning comment but is not blocked.
Volume Size Thresholds
Performance violation severity scales with declared data volume:
| Size | Row Range | Performance Severity | Blocks? |
|---|---|---|---|
| S | 0 -- 10K | info | No |
| M | 10K -- 100K | warning | No |
| L | 100K -- 1M | warning | No |
| XL | 1M -- 50M | critical | Yes |
| XXL | 50M+ | critical | Yes |
Volumes are declared in radar.yml:
data_volumes:
users: M
orders: L
events: XL
audit_logs: XXL
Category Enforcement Summary
| Category | When It Blocks | Default Action |
|---|---|---|
| Architecture | Always (any violation) | Block |
| Runtime Risk | Critical severity only | Block on Critical |
| Performance | XL/XXL tables only | Block on XL/XXL |
| Reliability | Critical severity only | Block on Critical |
| Maintainability | Configurable | Warn |
| AI Advisory | Never | Advisory only |
Customizing Scores
Override default point values in radar.yml:
scoring:
architecture_violation: 10 # stricter
runtime_risk_critical: 12 # stricter
complexity_point: 0.5 # more lenient
violation_fixed: -10 # bigger reward for fixes
gates:
block_merge:
- metric: debt_delta_score
operator: ">"
value: 20 # more lenient threshold
warn:
- metric: debt_delta_score
operator: ">"
value: 10