The scan configuration helps you to fine-tune the scan by excluding parts of your code from the scan, uploading additional included directories or adding parser options.
Scan Configuration pop-up can be opened from the repository context menu.
The scan configuration pop-up is displayed. Fill the information in different fields.
The scan configuration fields are described below:
Excludes
You can exclude specific source files by providing JavaScript formatted regular expressions.
Examples:
Example | Code |
---|---|
Filer out files containing the keyword “test” | “.*test.*” |
Filter out everything but one file | “^(?!.*parse-this-file-only.cpp*$).*” |
Using escape characters to match special characters (+,.) | “.*test.c++*” |
Default Exclusions
Language | Regular expression | Description |
---|---|---|
Java | (?i)(test|generated|mock|thirdparty|third-party|3rd-party|3rdparty|external) | Any file path containing 'test', 'generated', 'mock', 'thirdparty', 'third-party', '3rd-party', '3rdparty' and 'external' would be excluded. |
C/C++ | thirdparty;third-party;3rd-party;external;generated;mock;test;build | Any file path containing 'thirdparty', 'third-party', '3rd-party', 'external', 'generated', 'mock', 'test' and 'build' would be excluded. |
C# | (?i)(.g.cs|example|mock|assemblyinfo.cs|.AssemblyAttributes.cs|.AnyCPU.Debug|.AnyCPU.Release) | Any file path containing '.g.cs', 'example', 'mock', 'assemblyinfo.cs', '.AssemblyAttributes.cs', '.AnyCPU.Debug' and '.AnyCPU.Release' would be excluded. |
Objective-C | thirdparty;third-party;3rd-party;external;generated;mock;test;build | Any file path containing 'thirdparty', 'third-party', '3rd-party', 'external', 'generated', 'mock', 'test' and 'build' would be excluded. |
Python | _init_.py;test | Any file path containing '_init_.py' and 'test' would be excluded. |
JavaScript | node_modules;.min.js;dist;external;assets;gulp;grunt;libs;-bundle.js;.bundle.js;swagger-ui;.config.js;-config.js;UNKNOWN_FILE;.git;.ebextensions;test;.lib;.library;.zip | Any file path containing 'node_modules', '.min.js', 'dist', 'external', 'assets', 'gulp', 'grunt', 'libs', '-bundle.js', '.bundle.js', 'swagger-ui', '.config.js', '-config.js', 'UNKNOWN_FILE', '.git', '.ebextensions', 'test', '.lib', '.library' and '.zip' would be excluded. |
TypeScript | node_modules;.min.js;dist;external;assets;gulp;grunt;libs;-bundle.js;.bundle.js;swagger-ui;.config.js;-config.js;UNKNOWN_FILE;.git;.ebextensions;test;.lib;.library;.zip;.d.ts | Any file path containing 'node_modules', '.min.js', 'dist', 'external', 'assets', 'gulp', 'grunt', 'libs', '-bundle.js', '.bundle.js', 'swagger-ui', '.config.js', '-config.js', 'UNKNOWN_FILE', ' .git', '.ebextensions', 'test', '.lib', '.library', '.zip' and '.d.ts' would be excluded. |
PHP | vendor;wp-content/plugins;protected/extensions;test | Any file path containing 'vendor', 'wp-content', 'plugins', 'protected', 'extensions' and 'test' would be excluded. |
Go | test | Any file path containing 'test' would be excluded. |
Kotlin | test | Any file path containing 'test' would be excluded. |
Solidity | test | Any file path containing 'test' would be excluded. |
SQL | test | Any file path containing 'test' would be excluded. |
Parser Options
Currently, parser o
Parsing invalid code:
By default, invalid code parsing is enabled but it can be disabled using the following option:
–parse-invalid-code=OFF
Note: Support for invalid code parsing is limited and may result in parser failure. In case this happens, please disable invalid code parsing.
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=
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
Uploading Includes
This option is only relevant for scanning C or C++ repositories. If an included file is not found in the source directory, the C/C++ parser will throw a warning message which contains the location of the missing include.
The accuracy of the parser can be improved by uploading the directories which contain the missing files with the correct path. Includes can be uploaded in .zip format.
Note: Source code from additional include directories will not be considered for analysis. It is only used to resolve header dependencies (type resolution).