Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Table of Contents |
---|
How to Set Source Code Filters
Specify the root directory
Before an analysis with Kiuwan is executed, you must specify the root directory where the source code files are located.
Image Removed
That root directory is the SOURCE_DIR of the analysis.
Kiuwan scans all the files under SOURCE_DIR before running the analysis.
Set source code filters
If there are files and directories you do not want to analyze, you can set a source code filter for them. Kiuwan provides Source Code Filters to specify the exact fileset you want to analyze.
This source code filter mechanism is based on Include include and Exclude Patternsexclude patterns.
Kiuwan’s include and exclude patterns are Antare 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 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 Removed
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 Removed
Specify the root directory
- Specify the root directory (SOURCE_DIR) where the source code files are located in Folder to analyze.
(By default, KLA will analyze every file in this folder).
Image Added - Click on Advanced
Image Added - A new window will appear
Image AddedInclude patterns specify
what subset(s) of files will be analyzed.
Exclude
patterns specify what subset(s) of file will not be analyzed.
- If you want to add patterns, click on the + button. A new window will appear:
Image Added - If you want to remove a pattern, select it and click on the - button.
- If you want to edit an existing pattern or copy the text, double click on it.
Image Added
Info |
---|
Please, bear in mind when defining patterns that Exclude patterns take precedence over Include include patterns. |
For example, if
If you define the patterns below |
, the analysis will not process any js file |
: |
|
|
The exclude pattern |
defines: |
exclude all .js files in any directory and with any name |
. Therefore, the include pattern |
has no effect. |
The table below explains
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 The whole SOURCE_DIR will be analyzed | Only the resulting fileset after inclusion of matched files will be analyzed | |
YES | Only Resulting the resulting fileset after exclusion of matched files will be analyzed | First, the exclusion pattern reduces the SOURCE_DIR Second, over the above fileset, only will be processed those files macthing the include patternwill be processed |