Using codebase-memory-mcp to find dead code in a Django project (49K nodes) #10
DeusData
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Indexed a full Django project (fastapi-clean architecture, 335 nodes / 859 edges) and ran dead code detection:
Found 12 functions with zero callers that aren't entry points (not route handlers, not
main()). A few were genuinely dead — leftover utility functions from a refactor. Others were test helpers that only get called via pytest fixtures (which the graph doesn't track yet).The key insight:
exclude_entry_points=truefilters out route handlers and framework-decorated functions automatically, so you don't get flooded with false positives. Without that flag, every route handler shows up as "dead code" because nothing in your codebase calls it directly — the framework does.For larger codebases, you can scope it:
search_graph(..., project="my-project")to avoid cross-project contamination if you have multiple repos indexed.Anyone else finding interesting results with dead code detection? Curious what the false positive rate looks like in different frameworks.
Beta Was this translation helpful? Give feedback.
All reactions