skillfed

cppclean

Find problems in C++ source that slow development of large code bases.

cppclean v0.13 106.4K downloads/30d#12,652 on PyPI726
Permissive license Apache license Abandoned released

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 cppclean

uv

uv add cppclean

poetry

poetry add cppclean

Installing 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

Environment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Software Development :: Quality Assurance

Tags

C++ unused code detectionunnecessary include finderC++ code analysis toolcompilation optimization C++C++ static analysisheader file cleanupC++ code quality checker
c++-analysisstatic-analysisbuild-optimization

More Quality Assurance packages