A fast static analysis tool that finds unused (dead) code in Python programs to improve code quality.
Vulture is a static analysis tool that finds unused (dead) code in Python programs, including functions, classes, variables, imports, and unreachable code. It helps developers clean up large codebases, identify untested code, and improve overall code quality by highlighting what can be safely removed. The tool uses abstract syntax tree (AST) analysis to provide fast results without executing the code.
Python developers working on medium to large codebases who want to maintain clean, efficient code and identify untested or obsolete code paths. It's also useful for teams integrating code quality checks into CI/CD pipelines or pre-commit hooks.
Vulture offers a fast, static approach to dead code detection with configurable confidence scoring and whitelist support to handle false positives. Unlike coverage-based tools, it doesn't require code execution, making it easy to integrate into development workflows. Its compatibility with pyflakes output and extensive configuration options make it a practical choice for ongoing code maintenance.
Find dead Python code
Uses Python's ast module for syntax-based detection without code execution, making it quick and efficient for scanning large codebases, as noted in the README.
Assigns confidence values (60-100%) to dead code, with a --min-confidence flag to filter results, allowing developers to focus on high-certainty issues first.
Supports generating or using whitelist files to suppress false positives, with auto-generation via --make-whitelist, improving precision over time.
Includes pre-commit hooks, GitHub Actions, a VS Code extension, and a programmatic API, making it easy to embed into CI/CD pipelines and development workflows.
Identifies dead code after control flow statements like return or break, and unsatisfiable conditions, helping catch logical dead ends that other tools might miss.
Due to Python's dynamic nature, Vulture often reports false positives or misses dead code, requiring manual whitelist management, as admitted in the README.
Creating and maintaining whitelists can be tedious; auto-generated whitelists may need manual modifications to be syntactically correct, adding overhead.
Cannot detect code used dynamically (e.g., via reflection or decorators), making it less reliable than execution-based tools like coverage for certain code paths.
An extremely fast Python linter and code formatter, written in Rust.
The uncompromising Python code formatter
Optional static typing for Python
An extremely fast Python type checker and language server, written in Rust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.