In Development Developer Tool

GhostCode

Turns dead code into a P&L statement.

What it is

AST-based analysis that maps your codebase into a dependency graph, finds the code nothing calls, and prices it: lines of dead code times complexity, in dollars.

The problem

Dead code is invisible debt. Nobody deletes it because nobody can prove it is dead, so it keeps getting maintained, tested around, and read.

How it works

  1. Tree-sitter parses Python and JavaScript/TypeScript into ASTs.

  2. Imports resolve and call sites link into a NetworkX dependency graph.

  3. Functions with zero incoming edges are flagged as ghosts, each with a reason string.

  4. A cost model prices every ghost: lines of code times complexity.

01 Tree-sitter parses Python and... 02 Imports resolve and call sites link into... 03 Functions with zero incoming edges are... 04 A cost model prices every ghost: lines...
Pipeline, drawn from the steps above.

Features

Ghost detection
Zero-incoming-edge analysis with a human-readable reason per ghost.
Entry-point analysis
Mains, handlers, and exports are treated as roots so live code is never flagged.
Cost model
Dead code priced in dollars, so cleanup can be prioritized like any budget line.

Stack

  • Python
  • tree-sitter
  • NetworkX
  • pytest