mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 20:49:28 +00:00
feat(three-stage-scan): attach test-gap hints to hotspots
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user