Live Static Analysis Overview
Jtest can automatically and unobtrusively analyze code in the background so that you are instantly alerted when the code you are working on does not comply with your development policy. This Live Static Analysis helps you identify and fix problems as soon as they are introduced - without having to interrupt your workflow to start analysis.
When Live Static Analysis mode is enabled, the analysis is triggered on the following events:
- Opening a source file in the editor.
- Saving new or modified code in the workspace.
The on-save analysis will be run when you save code manually with the Save or Save All options. If code is automatically saved by your IDE, analysis will not be performed.
With Live Static Analysis mode enabled, some time-consuming operations and rules specified in the configuration you are using will be skipped to speed up analysis. These may include:
- Report Generation
- Source Control Information
- Publishing Reports to DTP
- Publishing Source Code to DTP
- Static Analysis rules that work on a global scope
When you enable Live Static Analysis mode, you will be notified of the features that will be disabled in the configuration that you specified. See Rules Supported by Live Static Analysis for the list of rules that are supported in Live Static Analysis mode. Code Duplicate Detection and Flow Analysis rules can be enabled in Live Static Analysis mode, but their scope is limited to ensure that analysis is performed in a reasonable time.
Enabling the Live Static Analysis Mode
Set the Active test configuration (see Setting the Active Test Configuration).
The test configurations set as Active will be used for continuous analysis. If you want to change the test configuration in Live Static Analysis mode, specify a different Active test configuration.
If the Active test configuration is not specified, Live Static Analysis mode will not be enabled.
Click the Live Static Analysis using [name of active test configuration] button between the Run [name of active test configuration] and Import Findings buttons to enable analyzing your code in real time.
If some rules or features of the configuration that you set are unavailable in Live Static Analysis mode, a message will appear specifying the settings that will be ignored. For example:
Working with Live Static Analysis Findings
Live static analysis findings will be reported in the Findings view. We recommend enabling the Link with Editor option to filter only the findings detected for the file you are working on (see Viewing Findings).
You can view detailed information about each finding in the Finding Details view (see Viewing Details about Analysis Findings).