Vulture is a static code analyzer that finds unused code in Python programs.
Vulture addresses the problem of identifying dead code in Python codebases through static analysis. Python's dynamic nature means that traditional static analyzers may miss some unused code or incorrectly flag code that is called implicitly, but Vulture still provides value by scanning for unused functions, classes, methods, variables, imports, and attributes. It assigns confidence values between 60% and 100% to each finding, indicating the likelihood that code is genuinely unused. This allows developers to filter results by confidence level, focusing first on certain dead code before investigating less certain cases.
Vulture suits developers maintaining large codebases who want to improve code quality and catch errors. It works well when run on both library code and test suites to identify untested functionality. The tool complements existing linters like pyflakes and uses the same output syntax, making it easy to integrate into existing workflows. The `--sort-by-size` option helps prioritize cleanup efforts by showing the largest unused code chunks first. For projects with many false positives, Vulture provides multiple suppression mechanisms: whitelists that can be generated automatically, file and directory exclusion patterns, and support for flake8 noqa comments.
The project maintains fast performance through static analysis and demonstrates high code quality with complete test coverage and self-testing. Development activity shows consistent attention to handling edge cases and user-reported issues, with particular focus on managing false positives through improved whitelist support and exclusion mechanisms. The maintainers actively curate whitelists for common Python modules and packages, accepting community contributions to expand coverage.