Find problems in C++ source that slow development of large code bases.
Project description
Goal
cppclean attempts to find problems in C++ source that slow development in large code bases, for example various forms of unused code. Unused code can be unused functions, methods, data members, types, etc to unnecessary #include directives. Unnecessary #includes can cause considerable extra compiles increasing the edit-compile-run cycle.
This is a fork of the original cppclean project. The original project home page, (which no longer contains code) is: https://code.google.com/p/cppclean/
Features
Find and print C++ language constructs: classes, methods, functions, etc.
Find classes with virtual methods, no virtual destructor, and no bases
Find global/static data that are potential problems when using threads
Unnecessary forward class declarations
Unnecessary function declarations
Undeclared function definitions
- Find unnecessary header files #included
No direct reference to anything in the header
Header is unnecessary if classes were forward declared instead
(planned) Source files that reference headers not directly #included, ie, files that rely on a transitive #include from another header
(planned) Unused members (private, protected, & public) methods and data
AST is Abstract Syntax Tree, a representation of parsed source code. http://en.wikipedia.org/wiki/Abstract_syntax_tree
Installation
$ pip install --upgrade cppclean
Run
$ cppclean <path>
Multiple include paths can be specified:
$ cppclean --include-path=directory1 --include-path=directory2 <path>
Current status
The parser works pretty well for header files, parsing about 99% of Google’s header files. Anything which inspects structure of C++ source files should work reasonably well. Function bodies are not transformed to an AST, but left as tokens. Such work is still needed on finding unused header files and storing an AST in a database.
Non-goals
Parsing all valid C++ source
Handling invalid C++ source gracefully
Compiling to machine code (or anything beyond an AST)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cppclean-0.1.1.tar.gz
.
File metadata
- Download URL: cppclean-0.1.1.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13125d509c6c83931811898ea5d9d9dd6e94f65bdf79a3f9d7e8c8e91922b8c1 |
|
MD5 | 9910bf87cc788b6972dd9abc9337025a |
|
BLAKE2b-256 | 16423d5bc7cee60b72d838cc7b8c5831a75965c918afcdc8408a71e91b9dbc91 |