codechecker icon indicating copy to clipboard operation
codechecker copied to clipboard

[analyzer] Cppcheck support

Open vodorok opened this issue 3 years ago • 1 comments

This commit adds support for the Cppcheck analyzer.

The following two commits are also squashed into this:

  • [test] Add new test cases for Cppcheck support
  • [analyzer] Check version compatibility

This commit is the resurrection of works made by Márton Csordás. The original pull request #2290 had three more refactoring related change sets which were omitted in this. Some changes were added in compared to the original commits:

  • The Cppcheck report converter is used to get the results in the result_handler.
  • The hash calculation logic has been uplifted to the latest one.
  • Some small small compatibility changes were added because of the changes in the code base.

Co-authored-by: bruntib [email protected] Co-authored-by: vodorok [email protected]

vodorok avatar Jun 09 '22 15:06 vodorok

Closes #484

vodorok avatar Jun 09 '22 15:06 vodorok

Should we support the --inonclusive analyzer flag? We use this at the sei cert results generation: https://arm.sero.gic.ericsson.se/artifactory/proj-sei-cert-generic-local/cpp/summary__codechecker_6.19.1_cppcheck_latest.html

Maybe add it in a follow-up ticket.

dkrupp avatar Aug 16 '22 10:08 dkrupp

The checker-config returns with an error. Please fix this before merging! (CodeChecker venv-dev) ednikru@seliiuvd02700[13:52][workspace/test-projects/tinyxml2]$ CodeChecker checkers --checker-config

.... clang-tidy:cert-msc32-c.DisallowedSeedTypes [ERROR 2022-08-16 13:52] - Failed to get checker configuration options for 'cppcheck' analyzer(s)! Please try to upgrade your analyzer version to use this feature.

dkrupp avatar Aug 16 '22 11:08 dkrupp

you may consider adding this analyzer option to the cppcheck plugin --max-ctu-depth=N Max depth in whole program analysis. The default value is 2. A larger value will mean more errors can be found but also means the analysis will be slower.

dkrupp avatar Aug 16 '22 11:08 dkrupp

:partying_face: