Skip to content

Epic: Dead Code Detection #426

Closed
Closed

Description

@ajianaz

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

  • cora dead-code CLI command
  • dead_code MCP tool
  • Entry point heuristics (main, new, drop, #[tokio::main], etc.)
  • Visibility-aware filtering (pub vs private)
  • Test function exclusion (--include-tests)
  • Min-line filter (--min-lines N) for tiny stubs
  • JSON output (--json)
  • Integration with cora scan (report dead code as findings)

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

Activity

  1. added
    scope:cli
    scope:code-intel
    epic:code-intelligence
    on Jul 29, 2026
  2. ajianaz commented on Jul 29, 2026

    @ajianaz
    CollaboratorAuthor

    Sub-issues

  3. ajianaz commented on Aug 1, 2026

    @ajianaz
    CollaboratorAuthor

    Implemented. Closing as completed — feature verified in codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:code-intelligencefeaturescope:cliscope:code-intel

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions