Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myint/cppclean
Finds problems in C++ source that slow development of large code bases
https://github.com/myint/cppclean
Last synced: 5 days ago
JSON representation
Finds problems in C++ source that slow development of large code bases
- Host: GitHub
- URL: https://github.com/myint/cppclean
- Owner: myint
- License: apache-2.0
- Created: 2013-05-31T14:31:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-07-26T14:09:22.000Z (over 2 years ago)
- Last Synced: 2025-01-06T09:02:52.785Z (5 days ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/cppclean
- Size: 807 KB
- Stars: 704
- Watchers: 27
- Forks: 59
- Open Issues: 60
-
Metadata Files:
- Readme: README.rst
- License: COPYING
Awesome Lists containing this project
- AwesomeCppGameDev - cppclean
README
========
cppclean
========.. image:: https://travis-ci.org/myint/cppclean.svg?branch=master
:target: https://travis-ci.org/myint/cppclean
:alt: Build statusGoal
====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 at https://code.google.com/p/cppclean/.Features
========cppclean finds the following:
- Classes with virtual methods, no virtual destructor, and no bases
- Global/static data that are potential problems when using threads
- Functions that are declared but not defined
- Unnecessary forward class declarations
- Unnecessary function declarations
- Undeclared function definitions
- Unnecessary #includes in header files
- No direct reference to anything in the header
- Header is unnecessary if classes were forward declared instead
- Inconsistent case in #includes (``foo.h`` versus ``Foo.h``)
- (planned) Unnecessary #includes in source files
- (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
- (planned) ``using namespace std`` in header files
- (planned) Methods that are declared but not definedAST is Abstract Syntax Tree, a representation of parsed source code
(https://en.wikipedia.org/wiki/Abstract_syntax_tree).Installation
============::
$ pip install --upgrade cppclean
Run
===::
$ cppclean
Multiple include paths can be specified::
$ cppclean --include-path=directory1 --include-path=directory2
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.Non-goals
=========- Parsing all valid C++ source
- Handling invalid C++ source gracefully
- Compiling to machine code (or anything beyond an AST)Links
=====* Coveralls_
.. _`Coveralls`: https://coveralls.io/r/myint/cppclean