Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Table of Contents |
---|
Source Code Filters
Before the execution of a Kiuwan analysis, you must specify
...
the root directory
...
where the source files are located.
Info |
---|
That root directory is the SOURCE_DIR of the analysis. Kiuwan scans all the files under SOURCE_DIR before to run the analysis. |
Likely, your SOURCE_DIR
...
contains files and directories that you do not want to be analyzed.
Most common reasons are because your application
...
contains open-source, 3rd-party or auto-generated code.
In those cases, you will not want that code to be analyzed because the defects found in those will not be corrected and, also, are disturbing (decreasing) the indicators of your application.
Info |
---|
Kiuwan provides Source Code Filters to specify the exact fileset you want to analyze. This mechanism is based on Include and Exclude Patterns. |
Kiuwan’s include and exclude patterns
...
are Ant-style patterns, used to create subsets of files given a certain fileset.
Some example patterns might be (look
...
at https://ant.apache.org/manual/dirtasks.html for a full reference of Ant-syntax):
Image Modified
How to define exclusion and inclusion patterns
When
...
using Kiuwan Local Analyzer GUI, you can define both patterns by clicking
...
on Advanced
...
button and next dialog will open.
Image Modified
By default, you will find that there are
...
some pre-defined exclude patterns (common patterns that usually do not contain useful code to be analyzed) that you can modify if needed.
There
...
are +/- buttons
...
to add/remove patterns.
To create a new one, next dialog will be open and added to the current set of patterns.
Image Modified
Info |
---|
Include pattern(s) specify what subset(s) of files will be analyzed. Exclude pattern(s) specify what subset(s) of file will not be analyzed. Please, bear in mind when defining patterns that Exclude patterns take precedence over Include patterns. |
For example, if you define below patterns, the analysis will not process any js file.
- include : src/**.js
- exclude: **/**.js
First, exclude pattern is saying: "exclude all .js files in any directory and with any name". That will exclude all the js files from SOURCE_DIR. Therefore, include pattern makes nothing: the subset already does not contain any js file.
Info |
---|
There might be subtle combinations depending on the specified include/exclude patterns, so we recommend you to use exclude to reduce the resulting fileset to be analyzed. |
Table below explain how the whole mechanism works and what fileset will be analyzed by Kiuwan
|
| Include pattern | |
---|---|---|---|
|
| NO | YES |
Exclude pattern | NO | Whole SOURCE_DIR will be analyzed | Only resulting fileset after inclusion of matched files will be analyzed |
YES | Only Resulting fileset after exclusion of matched files will be analyzed | First, exclusion pattern reduces SOURCE_DIR Second, over the above fileset, only will be processed those files macthing the include pattern |