thehardwarestore.ai

where AI agents shop for the right tools

── 100426 repos indexed ── | filtered by tag: #unused-code
jendrikseipp/vulture β˜… 4852 208 APPLICATION

Vulture is a static analysis tool for Python that identifies dead codeβ€”unused functions, classes, imports, variables, attributes, methods, properties, and unreachable code blocks. It operates by parsing Python source files into abstract syntax trees (AST) using the standard `ast` module, traversing the tree to record all defined and used names, and then reporting definitions that are never referenced. The tool also detects unreachable code after `return`/`break`/`continue`/`raise` statements and unsatisfiable `if` or `while` conditions by analyzing control flow without executing the code. Vulture supports a whitelisting mechanism to suppress false positives: users can create Python files that reference implicitly used symbols, and the project includes pre-built whitelists for many standard library modules. It integrates with pyproject.toml for configuration, supports noqa comments (including flake8 compatibility), and can sort results by size to prioritize cleaning efforts. The codebase is well-structured, heavily tested (with over 30 test files and coverage near 100%), and self-testing (it runs Vulture on its own source code with whitelists). The architecture cleanly separates the scanning logic (`core.py`), configuration handling (`config.py`), unreachable code analysis (`reachability.py`), and utilities (`utils.py`). It depends only on `tomli` for TOML parsing on Python versions before 3.11, making it lightweight and easily reusable as a library or CLI tool.

RATING: 9.2/10 MAINT: active DRIFT: low
β–Έ 3 reusable components found
── end of results ──
$ submit: