Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Amount of issues found with eclipse is different than with cpptestcli

Jan
Jan Posts: 8

When we analyze our code from Eclipse we use the compile_commands.json file as input. Then we click on the project name and start the analyzation.

When we use cpptestcli on terminal the build_commands.json file is also used as input. We set the -workspace argument and the ruleset which should be used.

The result is different concerning the found issues. The eclipse plugin handles the input scope in anotehr way and therefore more issues will be found. I know tha we can scope the input more with -module parameters and so on. But what will be the easiest solution to get the same results from cppptestcli as the eclipse plugin does? I am not achieving the same amount of issues with the cpptestcli call with parameters as the eclipse plugin does. What should i do?

Best Answer

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 admin
    edited March 2023 Answer ✓

    @Jan ,

    Did you have a chance to examine the differences in results between Eclipse and CLI? Is it perhaps that Eclipse runs find violations in header files where CLI does not report them?
    If it is so, I would add "-module proj-root" option to the CLI run with "proj-root" pointing to the root folder of your project (corresponding to the top-level node in your Eclipse project). See if it helps, otherwise we will look further.

Answers

  • Jan
    Jan Posts: 8

    @Bogdan Czwartkowski thanks a lot that fixed it. Nevertheless i share my investigation results.

    Indeed there are header files involved. I tried some differnet cpptestcli calls from the Project folder.
    Project is structed like this:
    Project-name(top level)
    |-demoApplications
    |-external_libs ()
    |-inc
    |-src

    1) Eclipse ==> 96 files are checked
    2) cpptestcli with -module internal=./src -module external=./external_libs -module DemoApp=./DemoApplications ==> 50 files checked
    3) cpptestcli with -module ==> 96 files checked

    1 and 3 have the same issue amount.
    Puh, i tried so many cpptestcli parameters that it seems i missed the obvious solution. Sorry for the noise.

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 admin

    @Jan ,

    Many thanks for the update. And no need to be sorry, this is what the forum is for :)