Deadcode – a Tool to Find and Fix Unused (Dead) Python Code
summary
Built a new Python tool called deadcode that finds more kinds of unused code than vulture or ruff, including unused methods, attributes and empty .py files, and it can automatically remove them. Behavior tuning works by name, inheritance or decorator rules so common framework attributes aren’t false positives. Detection uses dot‑separated paths (falling back to vulture’s AST set strategy when uncertain). CLI supports --fix and --dry to preview changes; an example run reports seven removed items after applying fixes.
AI-written summary · about
chapters (8)
- 0:00Introduction to Deadcode
- 1:08What is dead code
- 2:55Limitations of existing tools
- 6:29Creating Deadcode tool
- 8:02Key features of Deadcode
- 12:48Using Deadcode package
- 15:03Comparison of detection strategies
- 19:34Conclusion and call to action
related talks
38mDeleting Code Is Hard And You Should Do It
35mKill your Dead Code with Fire!
45mRemoving Dead Code from a Project: A Practical Guide
30mDead Code Shouldn't Exist
29mCode Quality in Python - tools and reasons
12mDelete all code! 100% testing coverage, the lazy way!
27mStatic Code Analysis with Python
01h 22mHow to Delete Code
