antiagainst / codeclimate-cppcheck

Code Climate Engine for Cppcheck
MIT License
27 stars 17 forks source link
climate-engine codeclimate cppcheck static-analysis

Code Climate Cppcheck Engine

codeclimate-cppcheck is a Code Climate engine that wraps Cppcheck. You can run it on your command line using the Code Climate CLI, or on our hosted analysis platform.

Cppcheck is a static analysis tool for C/C++ code.

Installation

  1. If you haven't already, install the Code Climate CLI.
  2. [optional] Run codeclimate engines:install cppcheck to install the Code Climate Cppcheck engine.
  3. Configure your .codeclimate.yml file. See example below.
  4. You're ready to analyze! Browse into your project's folder and run codeclimate analyze. If you skipped step 2, the Cppcheck engine will automatically be installed at this point, assuming it's enabled in .codeclimate.yml.

Configuration

Like the cppcheck command line tool itself, you can configure various aspects of the static analysis. Right now, the following options are supported in .codeclimate.yml:

Additional options may be supported later.

An example .codeclimate.yml file:

version: "2"
plugins:
  cppcheck:
    enabled: true
    config:
      check: all
      project: compile_commands.json
      language: c++
      stds:
        - c++11
      platform: unix64
      defines:
      - "DEBUG=1"
      - "__cplusplus"
      undefines:
      - "DEBUG"
      includes:
      - include/
      max_configs: 42
      inconclusive: false
      dump: false
      dump: false
      suppressions-list: .cppcheck-suppressions
      inline-suppr: true
      jobs: 4
      library: googletest

Need help?

For help with Cppcheck, check out their documentation.

If you're running into a Code Climate issue, first look over this project's GitHub Issues, as your question may have already been covered. If not, go ahead and open a support ticket with us.