feat(three-stage-scan): attach test-gap hints to hotspots

This commit is contained in:
Marius Ciepluch
2026-09-03 20:33:48 +02:00
parent b05fbbc3a5
commit 8d5599ae65
6 changed files with 470 additions and 12 deletions
+2 -9
View File
@@ -7,6 +7,7 @@ from pathlib import Path
from ..findings import StaticFinding
from ..preprocess import FileTarget
from .hints import TestHint, attach_test_hints
from .signals import ComplexitySignals, collect_signals
# Score cutoffs for hotspot bands; inventory density is not the rank driver.
@@ -14,15 +15,6 @@ _HIGH_SCORE = 6.0
_MEDIUM_SCORE = 3.0
@dataclass(frozen=True)
class TestHint:
path: str
function_name: str | None
gap: str
test_kind: str | None
reason: str
@dataclass(frozen=True)
class Hotspot:
path: str
@@ -52,6 +44,7 @@ def build_complexity_map(
collected = collect_signals(targets, findings, repo_files=repo_files, sources=sources)
ids_by_path = _inventory_ids_by_path(findings)
hotspots = tuple(_hotspot_from_signals(item, ids_by_path.get(item.path, ())) for item in collected)
hotspots = attach_test_hints(hotspots, targets, repo_files=repo_files, sources=sources)
complexity_map = ComplexityMap(hotspots=hotspots, heuristic_only=True)
write_complexity_map(complexity_map, output_path)
return complexity_map