Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I ask klocwork to ignore a directory while executing the kwinject command?

I am trying to run the kwinject command. The problem is that one of my Makefiles compiles a directory that I do not want to scan, so, is there a way to exclude these files? I have tried with kwinject --ignore-files {directory-where-makefile-points-at/*} but it is not working.

Do you guys know if is that possible?

like image 486
Lost Avatar asked Sep 20 '25 04:09

Lost


2 Answers

Yes it is possible.

According to kwinject --help (version 12.0.0.613), the option you should use is defined as:

-I, --ignore-files PATTERN[,PATTERN...]

Thus, you should just write a comma-separated list without any brackets. For example: --ignore-files somefile.c,*/googletest/* has been working for me when I want to ignore somefile.c and all googletest directories in my workspace.

like image 188
Macoux Avatar answered Sep 23 '25 05:09

Macoux


Macoux Answer worth a try. This should help you achieve your goal.

i would recommend not to ignore the directory from analysis but ignore the results from the report. Here is the procedure to do that, https://developer.klocwork.com/resources/blog/analyze-3rd-party-code-exclude-it-results

if you ignore the directory from analysis then there are high chances that you may end up in missing dependent data flow issues.

Additionally, why do you want to ignore the directory?

  1. if it is because of build time, you can try --incremental option with kwbuildproject. This can perform incremental/delta analysis for you.
  2. If it is because of 3rd party code what you dont want to see as part of report, try this https://developer.klocwork.com/resources/blog/analyze-3rd-party-code-exclude-it-results
like image 33
Sivanesh Waran Avatar answered Sep 23 '25 07:09

Sivanesh Waran