...
You can restrict the scope of analysis to locally modified files or to files modified on the current working branch by setting up additional file filters. This allows you to focus on identifying and fixing bugs introduced by your recent code changes before the code is checked in your source control system or merged with the main development stream.
Info | ||
---|---|---|
| ||
While modifying the default scope allows you to speed up analysis, it may impact violations reported by rules that require information about other resources included in the project. In particular, rules that analyze execution paths, calculate metrics, or check for duplicate code may be prone to reporting false positives or negatives if they have no access to files excluded from the scope. For this reason, we recommend that you regularly perform full-scope analysis to ensure that all rule violations are detected. One example scenario is that a limited scope is analyzed when working with C/C++test on the desktop, while a full-scope analysis is performed during automated builds on a server. |
Prerequisites
- Connection to a supported source control system must be properly configured (see Connecting to Source Control and Source Control Settings).
- The
scope.scontrol
=true
setting must be configured to enable computing authorship based on your source control system (see Scope and Authorship Settings).
...
To narrow down the scope of analysis to files that are different between your on the current working branch and that differ from the main integration stream, such as "master" or "trunk", add the following option in your .properties configuration file:
Code Block |
---|
scope.scontrol.files.filter.mode=branch |
If you want to compare your working branch with another branch or with a specific revision rather than the main integration stream, you need to provide the name or ID of the branch or revision you want to use as reference. Te The following configuration narrows down the scope of analysis to files that are different between on the current working branch and that differ from a custom branch/revision:
...
Code Block |
---|
scope.scontrol.files.filter.mode=branch scope.scontrol.ref.branch=[name/ID of the custom reference branch/revision] cpptest.scope.adjuster.cu.enabled=true |
The scope filter settings configured in the .properties file affect all test configurations.
See Scope and Authorship Settings.
...