Find unused functions and methods in your PHP and Python codebases with style!
- ๐ Detects unused functions, methods and static attributes
- ๐ฏ Smart detection of interface implementations
- ๐ซ Excludes route-annotated methods in PHP
- ๐ Interactive HTML report with filtering capabilities
- ๐ Multi-processing for fast analysis
- ๐ Supports both PHP and Python codebases
- Add support for TS
- Detect unused classes (make them displayed in a new tab in the report)
- Detect unused variables and imports
python -m venv venv --without-pip
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
Analyze PHP codebase:
python deadcode.py /path/to/php/project --language php
Analyze Python codebase with result limit:
python deadcode.py /path/to/python/project --language python --limit 50
List all functions sorted by line count:
python deadcode.py /path/to/project --language php --list-functions
Run the test suite:
python -m unittest tests/test_python_analyzer.py
The tool generates an interactive HTML report:
Sort by name, lines, or usage count Toggle visibility of potential false positives Search and filter results Paginated results for easy navigation
Reports are generated as:
-
code_analysis_php.html for PHP analysis
-
code_analysis_python.html for Python analysis
-
๐จ Report Colors
-
๐ด Red: Unused functions
-
๐ Orange: Potential false positives
-
๐ฃ Purple: Static attributes