Analysis scope is something which helps you to narrow down the results to only the relevant issues. This in turn reduces the noise and the issues from the rules which may not be relevant for certain files
Its key features include:
- Helps in excluding certain files from detecting specific issues.
- It helps you to completely ignore some files.
- Exclude files from Duplications detection and Coverage calculations.
To use this feature on CodeScan cloud, open the project under the organization on which you need to run the analysis and proceed as follows:
Administration > General Settings > Analysis Scope
Now you will be able to view the tab under which you can select your required specification to enable this feature during the analysis
Wildcards:If you scroll the tab further to the end, you can see a portion which says wildcards under which there are rules and examples which help you understand how to enter the specifications or part of the file name to enable this feature.
If we go under files, we will be able to view two options as follows:
- Source File Exclusions - to exclude source code files
Specifying an exclusion means that everything under your directory will be included in analysis except the files with paths that match your exclusion pattern.
- Source File Inclusions - It helps you to include only the specific source code files in the analysis
In a few corner cases, it is necessary to be explicit about what's included in analysis and leave out everything else, but that is not the normal case, and setting inclusions should not be the first thing you try when configuring a new project.
Now, Once the analysis is complete go to the “code” tab to view the files as per your specified settings like the image below
Here are a couple of implementation example images below:
For Source File Exclusion,
For Source File Inclusion,