Steps to navigate to Scan Configuration Option:

  1. Click on Projects option on the left side navigation pane.
  2. Inside your project, click on a repository and then click on three dots “” on the top right corner. Select the Scan configuration option.

Scan Configuration window consists of:

  1. Exclusion
  2. Additional Options
  3. Inclusion
  4. Includes

Exclusion:

We can exclude particular source files by providing regular expressions. Regular Expression Format: JavaScript

Examples:

  1. To filter out files containing “test” keyword -> “.*test.*”
  2. To filter out everything but one file -> “^(?!.*parse-this-file-only.cpp*$).*”
  3. Use escape character to match special characters like +, . -> “.*test.c++*”
A semi-colon list of regular expressions should be added in Scan Configuration pop-up window >> exclusion

Additional Options:

  • Parsing invalid code:
    By default, invalid code parsing is enabled but, it can be disabled using the following option.
    –parse-invalid-code=OFF
Note:
There is limited support for invalid code parsing, and it is prone to parser crash (very rare), so if for some codebase parser is crashing, please disable the invalid code parsing.
  • Recursive include header search

By default, the parser searches for any header file recursively in all the sub-directories of the source folder. This can lead to incorrect results if there are multiple header files with the same name but in different folders.
To disable searching in all sub-directories use the following option
—include-all=OFF

semi-colon list of regular expressions should be added in Scan Configuration pop-up window >> Additional Options
  • Define macros
    Macros can be defined with GCC like option format.
    Example: To define macro MY_MACRO -> –clang=”-DMY_MACRO=”
    Any option to compiler can be given with –clang=””

Inclusion

  • comma-separated list of regular expressions should be added in Scan Configuration pop-up window >> inclusion

Includes

  • Look for Includes label and upload zip of include files.
  • Click Save.