Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Python
  3. vulture

vulture

MITPythonv2.16

A fast static analysis tool that finds unused (dead) code in Python programs to improve code quality.

GitHubGitHub
4.5k stars184 forks0 contributors

What is vulture?

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.

Target Audience

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.

Value Proposition

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.

Overview

Find dead Python code

Use Cases

Best For

  • Identifying unused imports and variables in Python projects
  • Cleaning up legacy codebases with large amounts of dead code
  • Finding untested functions by analyzing both source and test files
  • Detecting unreachable code blocks after control flow statements
  • Integrating dead code checks into pre-commit or CI/CD pipelines
  • Prioritizing code removal by sorting dead code by size (line count)

Not Ideal For

  • Projects with heavy metaprogramming or dynamic code execution (e.g., using eval() or plugin systems)
  • Teams needing 100% accurate dead code detection without any false positives or manual review
  • Small, single-file scripts where dead code is minimal and setup overhead outweighs benefits

Pros & Cons

Pros

Fast Static Analysis

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.

Configurable Confidence Scoring

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.

Whitelist Support for Accuracy

Supports generating or using whitelist files to suppress false positives, with auto-generation via --make-whitelist, improving precision over time.

Comprehensive Integration

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.

Unreachable Code Detection

Identifies dead code after control flow statements like return or break, and unsatisfiable conditions, helping catch logical dead ends that other tools might miss.

Cons

High False Positive Rate

Due to Python's dynamic nature, Vulture often reports false positives or misses dead code, requiring manual whitelist management, as admitted in the README.

Complex Whitelist Management

Creating and maintaining whitelists can be tedious; auto-generated whitelists may need manual modifications to be syntactically correct, adding overhead.

Limited to Static Analysis

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.

Frequently Asked Questions

Quick Stats

Stars4,543
Forks184
Contributors0
Open Issues44
Last commit2 days ago
CreatedSince 2017

Tags

#developer-tools#pre-commit#python#code-quality#linting#ast#static-analysis#dead-code-detection

Built With

P
Python

Included in

Python290.8kStatic Analysis & Code Quality14.5k
Auto-fetched 1 day ago

Related Projects

ruffruff

An extremely fast Python linter and code formatter, written in Rust.

Stars47,214
Forks2,026
Last commit1 day ago
blackblack

The uncompromising Python code formatter

Stars41,476
Forks2,758
Last commit2 days ago
mypymypy

Optional static typing for Python

Stars20,386
Forks3,169
Last commit1 day ago
tyty

An extremely fast Python type checker and language server, written in Rust.

Stars18,401
Forks282
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub