Goal
Add cora dead-code command that identifies unreachable symbols — functions, methods, and procedures with zero callers.
Context
Cora already has call_graph (6K+ edges), find_callers(), and trace_path(). Dead code detection is a direct query on existing infrastructure — find symbols with zero incoming CALLS edges, excluding entry points.
Scope
Pre-requisite
- Wire up
store_kg_edges() — edges table exists but is never populated
- Consider: should dead code use
call_graph (legacy) or edges (new) table?
Acceptance Criteria
cora dead-code lists unreachable functions with file:line
cora dead-code --json returns structured output
- MCP
dead_code tool works in agent context
- Performance: < 10ms on cora-code repo (115 files, 6K edges)
Estimated Effort
2-3 days
Goal
Add
cora dead-codecommand that identifies unreachable symbols — functions, methods, and procedures with zero callers.Context
Cora already has
call_graph(6K+ edges),find_callers(), andtrace_path(). Dead code detection is a direct query on existing infrastructure — find symbols with zero incoming CALLS edges, excluding entry points.Scope
cora dead-codeCLI commanddead_codeMCP tool--include-tests)--min-lines N) for tiny stubs--json)cora scan(report dead code as findings)Pre-requisite
store_kg_edges()—edgestable exists but is never populatedcall_graph(legacy) oredges(new) table?Acceptance Criteria
cora dead-codelists unreachable functions with file:linecora dead-code --jsonreturns structured outputdead_codetool works in agent contextEstimated Effort
2-3 days