v0.1.0 • MIT License

Find Dead Code
Blazingly Fast

A lightning-fast Python dead code detector written in Rust.
10-50x faster than Vulture. Tree-sitter powered. Zero dependencies.

Terminal
# Install from crates.io
cargo install pydeadcode

# Analyze your Python code
pydeadcode main.py

Dead Code Found:
main.py: line 42 - unused_function [function] (80% confidence)
main.py: line 89 - DeadClass [class] (80% confidence)

2 dead code items found

Why PyDeadCode?

Lightning Fast

10-50x faster than Vulture. Analyze 1000+ lines in ~50ms. Written in Rust for maximum performance.

🎯

Highly Accurate

95%+ accuracy using tree-sitter AST parsing. Smart heuristics minimize false positives.

🧠

Intelligent Detection

Recognizes magic methods, decorators, test functions, and entry points automatically.

📊

Confidence Scoring

60-85% confidence levels based on context. Private functions get higher confidence scores.

📦

Zero Dependencies

Single binary, no Python installation needed. Works on Linux, macOS, and Windows.

🎨

Beautiful Output

Color-coded terminal reports with line numbers and confidence levels for easy navigation.

Installation

📦 Cargo (Recommended)

# Install Rust first: https://rustup.rs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install pydeadcode
cargo install pydeadcode

# Verify installation
pydeadcode --version

🔧 From Source

# Clone repository
git clone https://github.com/utsav-pal/pydeadcode.git
cd pydeadcode

# Build release version
cargo build --release

# Binary at target/release/pydeadcode
./target/release/pydeadcode --version

🗑️ Uninstall

# Uninstall pydeadcode
cargo uninstall pydeadcode

# Verify removal
pydeadcode --version
command not found

Usage Examples

Basic Usage

# Single file
pydeadcode app.py

# Multiple files
pydeadcode file1.py file2.py

# All files in directory
pydeadcode src/**/*.py

Advanced Options

# Set confidence threshold
pydeadcode main.py --min-confidence 75

# JSON output for CI/CD
pydeadcode main.py --json > report.json

# Verbose output
pydeadcode main.py --verbose

What Gets Detected

Type Confidence Example
Unused Functions 80% def unused(): pass
Unused Classes 80% class UnusedClass: pass
Unused Methods 70% def method(self): pass
Private Unused 85% def _private(): pass
Decorated Unused 60% @decorator
def func(): pass

Performance Comparison

PyDeadCode
50ms
Vulture
2.5s 50x slower
Pylint
15s 300x slower

Benchmark: 1000+ line Python codebase on Intel i7, 16GB RAM

Documentation

Ready to Find Dead Code?

Install PyDeadCode and start cleaning up your Python projects today.