computations / softwipe

Check and score C/C++ software quality

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

softwipe

A tool for automatically checking the software quality of a C/C++ program and giving it a score. It is developed as part of my Hiwi project at the Heidelberg Institute for Theoretical Studies (HITS). The background for doing this is the appearent lack of quality in evolutionary biology software as found in this paper: https://academic.oup.com/mbe/article/35/5/1037/4828033

Softwipe runs various checks to produce a software quality score: it compiles your program using clang and checks for compiler warnings; it activates almost all available warnings here. It runs your program with clang sanitizers activated, which detect memory errors and undefined behavior. It checks for the usage of assertions. It runs the following static code analyzers: cppcheck, clang-tidy, KWStyle, and lizard. Lizard is also used to find your programs average cyclomatic complexity and code duplication.

Installation & Usage

Clone this repository to download softwipe:

git clone https://github.com/adrianzap/softwipe.git

Dependencies

There's some dependencies, but fear not! For macOS and Debian-based systems, softwipe can automatically install these dependencies for you. Just run softwipe (sudo ./softwipe.py - sudo is most likely required for installing the dependencies); if a dependency cannot be found, it will ask you whether it should automatically install it. Note for Mac users: Homebrew must be installed for the automatic installation of dependencies.

The following tools must be installed:

For make-based projects, you also need:

Also, if the program you want to check uses make oder CMake as build system, make and CMake must be installed respectively.

Basic usage

Softwipe can be run as follows:

softwipe.py [-c | -C] [-M | -m | -l target [target ...]] [-e EXECUTEFILE] programdir

Where:

-c tells softwipe that your program is C, and -C tells softwipe that you program is C++.

-M tells softwipe to build your program using CMake, -m using make, and -l using clang. The -l option takes as arguments the files to compile.

-e specifies the path to an "execute file" which contains a command line that executes your program.

programdir specifies the root directory of your target program.

Example command line for a CMake-based C++ program:

softwipe.py -CM path/to/program -e path/to/executefile

For more options and further information, run softwipe.py --help.

About

Check and score C/C++ software quality

License:Other


Languages

Language:Python 100.0%