Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
fix(dead-code): state the withheld unused_internal reason as a measurement (#3668)
Swati Ahujaa2c99e6f9414
diff --git a/packages/core/src/repowise/core/analysis/finding_registry.py b/packages/core/src/repowise/core/analysis/finding_registry.pyindex c6b2513c0..1e791c007 100644--- a/packages/core/src/repowise/core/analysis/finding_registry.py+++ b/packages/core/src/repowise/core/analysis/finding_registry.py@@ -66,8 +66,8 @@ REGISTRY: dict[str, FindingTypeStatus] = {corpus=f"{_LABELLED}, 1,511 in all",measured_on="2026-09-29",reason=(- "Private-symbol findings were almost all false: TS/JS/Python emit no "- "'reads' edges, so same-file uses are invisible to the graph."+ "Measured on TS/Python code: private-symbol findings were almost all "+ "false, because same-file uses leave no 'reads' edge there."),),"duplicated_assertion_block": FindingTypeStatus(diff --git a/tests/unit/dead_code/test_serving.py b/tests/unit/dead_code/test_serving.pyindex 7497fec39..9f2286cac 100644--- a/tests/unit/dead_code/test_serving.py+++ b/tests/unit/dead_code/test_serving.py@@ -151,6 +151,16 @@ def test_safe_only_note_explains_an_empty_safe_only_view() -> None:assert "safe_only_note" not in build_summary(summary_counts(unproven), 1, _filters(), {})+def test_a_withheld_type_names_where_it_was_measured() -> None:+ # The reason is served for any repository, so it states its corpus rather+ # than reading as a fact about the code at hand (here Kotlin).+ filters = _filters(withheld_kinds=frozenset({"unused_internal"}))+ _shown, withheld = filters.split_withheld([_row("src/App.kt", 0.9, kind="unused_internal")])+ summary = build_summary(summary_counts([]), 0, filters, withheld)+ reason = summary["withheld_types"]["unused_internal"]["reason"]+ assert reason.startswith("Measured on TS/Python code:")++def test_serialization_is_the_same_for_rows_and_mappings() -> None:row = _ROWS[0]as_dict = serialize_finding(row, repository="r")