Getting started with Klocwork Desktop for C/C++
Getting started with Klocwork Desktop for C/C++Klocwork Desktop is a GUI alternative to the command-line desktop analysis tool, kwcheck. Like kwcheck, Klocwork Desktop is for developers using IDEs and text editors that aren't supported in the form of an IDE plug-in. Note: If you access your source code and compilers remotely, use Klocwork Desktop in remote mode .
Getting the workflow rightkwgcheck and kwcheck work together to help you set up your build analysis. kwgcheck provides a handy GUI that you can use to set up and configure your projects, though it will likely be necessary to run kwcheck from the command line as you configure your analysis build. When you go back to the command line from the GUI, minimize kwgcheck to the system tray and continue capturing your build settings in the console, by running make and by running kwcheck to analyze the results of your build. As your analysis detects new defects, the defects will be reported by the kwgcheck tool. You will see notifications in the system tray as well. Any files that are opened outside of the command line will be analyzed as part of the build. It's a good idea to follow this workflow to ensure that your kwgcheck instance is always accurate and up to date. Set up a local projectFor each coherent, buildable component that you work on, create a local project -- a repository for your analysis results and settings. You need to set up a project only once for each component you work on. You get the most from static code analysis when you connect a small local project to a larger project on the Klocwork Server. The small local project is analyzed quickly while incorporating Klocwork knowledge bases generated on the server where additional source files were analyzed (for example, shared libraries). Connecting to a server project also allows you to share issue status information with the integration build analysis and among team members. You can run a standalone desktop analysis, but the analysis only derives knowledge from the local project's source files. You perform this step only once for each project. Project setup includes capturing build settings. Klocwork uses a build specification to perform an analysis. The build specification contains a list of the project's source files and their compiler options (includes and defines).
Capture your build settings with kwshellThis section does not apply if you use a build specification template.
See also Troubleshooting. Continuous analysis when you open filesContinuous analysis provides automatic issue detection and error highlighting while you work. Watch a demo. Double-click a file in the Project Navigator to open it in the viewer and launch the analysis. Detected issues are highlighted in the viewer. Tips:
Continuous analysis on an entire projectBy default, Klocwork Desktop performs continuous analysis on only those files that are currently open. You can configure Klocwork Desktop to perform continuous analysis on the entire project. As you use Klocwork Desktop, the project folder is scanned and analysis is performed on any modified file regardless of whether or not the file is currently open. To enable continuous analysis on an entire project:
Note: Continuous analysis is not supported in Klocwork Desktop remote mode.
Investigate detected issues
Fix defects and ignore the restFor a real defect:
For an issue that doesn't need to be fixed:
If you're connected to a project on the Klocwork Server, your changes are now visible to other developers, and in Klocwork Static Code Analysis. Your desktop project is also updated with any changes made by other developers. This happens even before another integration build analysis has been run. Before you check in
|