Tips and tricks for Klocwork Desktop
Tips and tricks for Klocwork Desktop
The following topics provide tips and tricks for using Klocwork Desktop. You can also use Working sets to select a set of files and have that selection persist from one Klocwork Desktop session to another.
Minimize Klocwork Desktop to the system tray
By default, when you click the X icon in the upper right corner of the Klocwork Desktop window, the application closes. If you want to have Klocwork Desktop minimize to the system tray and run in the background when you click the X icon, go to Window > Preferences > Klocwork > Analysis Settings and select the Leave Klocwork Desktop running in background when window is closed check box. When minimized, you will see notifications in the system tray.
Klocwork Desktop status icons
|Status icon||What it means|
|No errors; connections are working as expected|
|Error with configuration; could be license or Klocwork Server related. Click on the icon to open your preferences and fix the problem.|
|No errors; project is not synchronized to the server|
|Synchronization currently in progress|
|Project is synchronized with the server and working as expected|
|Synchronization error; Local project could not be synced with the server|
Start and connect to your remote project in one step
After you open Klocwork Desktop for the first time, you can launch Klocwork Desktop and connect to your remote project in one step. Run kwgcheck on the command line and specify either the remote configuration file you used in your last session, or the URL.
View only local issues
Locate system issues
For connected desktops, you may need to investigate or fix a system issue. Klocwork Static Code Analysis provides a System ID for each detected issue. By default, the connected desktop does not identify issues by System ID in the issue list.
Show the System ID in your issue list
You can show the System ID in your issue list by configuring your columns.
- Click the and select Configure columns.
- Select System ID.
Any issue that was also detected in the integration build analysis will show a System ID.
- To view the issue in Klocwork Static Code Analysis, click the ID hyperlink.
- To view the most recent traceback for the issue on your desktop, double-click the issue in the Klocwork Issues view and investigate the identified traceback events.
- Fix the issue in your editor and save your file.
If the issue disappears from the list, it's fixed.
Filtering and grouping
- Click in the Klocwork Issues view.
- Under Show issues for, select Selected element and its children.
- Click OK.
When you select folders or source files in the left pane, the issue list displays only issues detected in the item(s) you select.
- If you still don't see the issue, click and select Group by > Issue Type.
Show or hide columns in the Klocwork Issues view
You can customize the Klocwork Issues view to show or hide columns or change the order in which they appear. For example, you can show the Ref or System ID columns, which are hidden by default.
To configure columns, click and select Configure columns.
Note: You can't hide or change the position of the Description column. It will always appear first.
Change your connected project, analysis and server settings
Go to Tools > Preferences > Server Settings.
The Server Settings dialog is where you can:
- connect to a different Klocwork server host or port (when you need to connect your project with a different Klocwork server project)
- change your License Server host and port
- Use the classic engine: This option forces Klocwork to use the previous generation (pre-Klocwork 2018) analysis engine. The previous analysis engine only provides partial support for C++11 and C++14.
- disable or re-enable:
Enable generation of the full build log
By default, the short log option is enabled which produces an optimized and reduced version of the build.log file. If you prefer to see the full build log, go to Tools > Preferences > Klocwork > Analysis Settings and clear the option Enable Short Log.
Use loopback interface for internal connections
In some situations, the network configuration prevents Klocwork analysis tools from connecting to its temporary servers; the most common case is when you are connected to a virtual private network (VPN). To resolve the issue, you can enable a setting that forces analysis into 'local mode'.
Go to Tools > Preferences > Klocwork > Settings and select the option Use loopback interface for connections.
If the issue persists after enabling this option, you can create an environment variable called 'KW_NETWORKING_USE_LOOPBACK' and set its value to 1. This tells Klocwork to fall back to using your IP address for localhost, which helps to avoid DNS issues.
Use 32-bit analysis tools
In some situations, you may want to force Klocwork to use 32-bit analysis. For example, if you want to use 32-bit checkers (that is, checkers compatible with a pre-2020.3 version of Klocwork), you must select this option.