Configuring taxonomies and categories
Klocwork provides three default organizational structures, or taxonomies:
Each taxonomy contains a set of checkers, grouped by category. The three default taxonomies, as their names suggest, organize all checkers by language. You can set up taxonomies to report on whatever is important to you. For example:
You can create your own taxonomies. The structure you set up will be available for reporting in Klocwork Static Code Analysis and on connected desktops.
Opening the standalone Taxonomy EditorThe standalone Taxonomy editor is used to configure custom taxonomies, categories and to edit reference information. It is accessed from the command line by running one of the following commands: To create a new configuration file, run the command: kwtaxonomyeditor The Taxonomy Editor will open in a new window and you can make any changes required. Once you are finished making changes, click OK . Now save the file where you can find it easily, then import it for your project using the kwadmin import-config command or by importing it through the Configuration tab for your specific project in Static Code Analysis. For projects with an existing configuration file, run the command: kwtaxonomyeditor <path/to/mytconf.tconf> In this scenario, make sure you are pointing to the taxonomy file for the project you wish to change. Example
kwtaxonomyeditor "C:\Klocwork\Server 18.1\taxonomies\cwe_10_cxx.tconf"
Creating and editing taxonomies and categoriesYou create and edit taxonomies and categories using the standalone Taxonomy Editor. Default taxonomies are read-only and cannot be edited.
Note: If you want to use a custom taxonomy that is in English within the Japanese installation, the language attribute should still be set to 'ja'. Any old taxonomies that do not have the language set should also be modified to include either 'en' or 'ja' as the locale.
Adding a checker to a taxonomyYou can add a checker in a few ways:
Note that because a checker can't appear more than once in a taxonomy, you can't copy-and-paste from one category to another within the same taxonomy; you can only cut-and-paste, or drag-and-drop.
Importing your taxonomy file in Klocwork Static Code AnalysisOnce you have created your custom taxonomy file (.tconf), you can import it for your project by doing the following:
Editing the Reference information for a checkerThe Reference field can contain any extra information you'd like to add for a checker. The Reference field is taxonomy-specific; this means that if a checker exists in multiple taxonomies, it can have multiple values for the Reference field. This also means that when you copy or move a checker from one taxonomy to another, the Reference information is not copied or moved. A typical use for this field is to map the checker to a rule in a standard. For example, the checker MISRA.ASM.ENCAPS detects violations of both MISRA-C rule 2.1 and MISRA-C++ rule 7-4-3. We've included both of these rule numbers in the Reference field for this checker. The Reference field is visible in Klocwork Static Code Analysis and in the developer desktop tools. In the desktop tools, it's shortened to "Ref". To change the reference value for a checker:
Reference information is included as a part of your customized .tconf file. |