Skip to main content

Module refactoring_targets

Module refactoring_targets 

Expand description

refactoring-targets analysis.

Ranks files by return-on-investment for refactoring: the intersection of low code health and high development activity, divided by inspection effort. priority = (structural_risk × hotspot_score) / max(loc, floor) — an effort-aware ranking so a small, dense, churning, unhealthy file outranks a large one with the same raw risk. Reuses the code-health composite (which also materialises the per-file biomarker table) and the hotspots activity signal; joins them per file.

Join semantic: results contain only files present in both the code-health output (files with parseable complexity surviving min_revs) and the hotspots output; because the code-health file set is a strict subset of the hotspots file set, code-health is the binding constraint — a churning file with no parseable complexity (unsupported, vendored, or skipped by the tree-sitter walker) will not appear in the output.

Research basis: effort-aware defect ranking (risk per unit inspection effort; Popt / PofB20) with an EA-Z-style size floor to avoid tiny-file ranking artifacts.

Structs§

RefactoringTargetRow

Functions§

run_refactoring_targets
Run the refactoring-targets analysis. Returns rows ranked by priority DESC (worst-ROI-debt first), truncated to opts.rows_limit.