3

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?

Lost
  • 161
  • 2
  • 11

3 Answers3

2

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.

Macoux
  • 21
  • 6
0

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
0

Add a module to the klocwork project that contains the code you want to suppress, and it will be suppressed.

scirdan
  • 59
  • 7