cppclean
Find problems in C++ source that slow development of large code bases.
What it is and what it does
cppclean is a static analysis tool for C++ that identifies problems in source code that can slow development cycles in large projects. It parses C++ headers and source files into an abstract syntax tree and detects issues like unused functions, methods, data members, and types; unnecessary forward declarations; undeclared definitions; and redundant #include directives. The tool reports inconsistent case in includes and can suggest removing headers that are not directly referenced.
The parser is designed to handle real-world C++ code reasonably well, achieving about 99% success on Google's header files. Function bodies are tokenized rather than fully parsed into an AST. The tool runs from the command line and accepts multiple include paths to analyze. However, it has been unmaintained since 2019 and may not support modern C++ syntax or recent Python versions.
Use it for:
- Reduce compilation time in large C++ projects by identifying and removing unnecessary #include directives in header files.
- Detect unused functions, methods, and data members that can be safely removed from a codebase.
- Find classes with virtual methods but no virtual destructors, a common source of memory leaks in C++.
- Identify global and static data that may cause threading issues in multi-threaded applications.
- Locate undeclared function definitions and unnecessary forward declarations during code review.
- Audit header files for inconsistent case in #include statements (e.g., foo.h vs Foo.h).
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
cppclean analyzes C++ source code to identify unused code, unnecessary includes, and structural problems that slow compilation in large codebases.
No. The package is abandoned (last release 2019-07-30, no commits since 2022-07-26) and has high install friction. While it may still work for basic C++ analysis, the lack of maintenance means it will not support modern C++ standards or recent Python versions. For active C++ projects, consider maintained alternatives.
Install
cppclean on PyPI
pip
pip install cppcleanuv
uv add cppcleanpoetry
poetry add cppcleanInstalling cppclean
Before you install
High install friction: the package is distributed as a source tarball and has been abandoned since 2019. Last release was 2019-07-30, with no commits since 2022-07-26.
License in practice
Licensed under Apache license (permissive), which allows commercial and private use with minimal restrictions, making it safe from a licensing standpoint for most projects.
Quickstart
pip install --upgrade cppclean
cppclean --include-path=directory1 --include-path=directory2
Requires a working C++ codebase to analyze; the tool parses C++ headers and source but does not compile or execute code.
Verify before relying
- Whether the parser remains compatible with modern C++ standards given the last release was 2019-07-30.
- Whether the tool works reliably with Python 3.10+ despite unspecified Python version support.
- Current state of the planned features (unnecessary includes in source files, transitive includes, unused members).
- Whether the tool still functions correctly with current Python interpreters after years without maintenance.
Package facts
| License | Apache license (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,572 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 106,408/month — #12,652 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cppclean-0.13.tar.gz
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
uncalledDetects unused functions in Python projects…
permissive · top 15,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
cxxheaderparserParses C++ header files into Python data…
permissive · top 15,000 on PyPI
deadcodeScans Python codebases to find and optionally…
agpl · top 15,000 on PyPI
deptryScans Python projects to detect unused,…
permissive · top 5,000 on PyPI
yesqayesqa automatically removes unnecessary `#…
permissive · top 15,000 on PyPI
creosoteCreosote scans your Python project's source…
permissive · top 5,000 on PyPI
fawltydepsFawltydeps identifies undeclared dependencies…
permissive · top 15,000 on PyPI
vultureVulture is a static code analyzer that finds…
permissive · top 5,000 on PyPI
pcodedmpDisassembles VBA p-code from Microsoft Office…
copyleft · top 5,000 on PyPI