The JetBrains (Including IntelliJ) and VS Code editing environments use two coordinated features to manage scanning and display issues encountered by scans that are run locally:
- Local View consolidates the older Code Analysis and Open Source Analysis views, displaying issues reported by software-integrity products that run on your local system.
- Scan configurations provide an interactive way to specify particular scanning products and how to run them.
Local View workflow
Workflow in IntelliJ
When you start IntelliJ and no scan configuration exists yet, Local View shows an Edit configurations button in the bar at top.
Click Edit configurations to open a Scan Configurations dialog where you can create new configurations.
Once you have created at least one scan configuration, the control that displayed Edit configurations changes to a drop-down menu. When not expanded, it displays the currently active configuration. When expanded, it displays configurations to choose from. Edit configurations remains a choice.
-
When you have chosen a scan configuration and Manual is the scanning mode, click the Run Scan icon to run a scan.
-
When you have run more than one type of scan, you can click the “clock face” icon to choose which set of results you want to view.
Figure 5. Scan results drop-down menu
Attention: A blinking orange dot can appear on the clock face icon. This indicates that new results are available for a scan that you are not currently looking at—in other words, for a scan that has been running in the background.If you move your mouse to hover over the icon, a tooltip will mention this, and if you click to open the drop-down clock menu, the entry for the new scan will be prefixed with ‘(new)’.
Workflow in VS Code
-
In Local View, the first time you click Run Scan, Code Sight displays a drop-down menu that prompts you to create a scan configuration.
Click Configure scan to open a Scan Configuration tab that lets you create a configuration.
Once you have created scan configurations, they appear in the Scan Configuration controls and also in the drop-down menu.
Click the name of a scan configuration to run that particular scan. Issues found by the scan now appear in the Local View list. When you click an issue in Local View, VS Code displays the code location and issue details as it did in the views from older Code Sight versions.
Creating a scan configuration
The Scan Configuration dialog (IntelliJ) or tab (VS Code) has controls for creating and managing scan configurations.
In IntelliJ
The list on the left shows scan configurations you have already created. Click the plus-sign icon to create a new scan configuration, or the minus-sign icon to delete a scan configuration that you have highlighted.
The fields on the right-hand side of the dialog depend on the type of scan you choose. Most give you a choice among existing options. The text in the Name field can be anything you enter.
When you click the plus-sign icon to create a new configuration, Code Sight displays a drop-down list that lets you choose the kind of scan that this will be.
In VS Code
The left-hand column of the Scan Configuration tab shows buttons for managing configurations. The right-hand column shows the settings for a particular configuration.
-
When you click the plus-sign button to create a new configuration, Code Sight prompts you to choose the kind of scan that this will be.
Figure 11. Buttons for choosing a scan type
-
You can also create a new configuration by clicking Copy scan configuration to copy and then paste the currently selected one. Code Sight appends “-copy” to the name of the new configuration.
The fields that display in the right-hand column depend on the type of scan you choose. Most give you a choice among existing options. The text in the Name field can be anything you enter.
Advanced options
This section of the Scan Configuration dialog or tab provides an interactive way to specify custom scan settings. Fields in this section are comparable to the choices you can specify using a project-specific coverity.conf file: See “Project-specific ‘coverity.conf’ files”.