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
-
Tree-sitter parses Python and JavaScript/TypeScript into ASTs.
-
Imports resolve and call sites link into a NetworkX dependency graph.
-
Functions with zero incoming edges are flagged as ghosts, each with a reason string.
-
A cost model prices every ghost: lines of code times complexity.
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