Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

checkers.xml: Defining the category, severity, and error message

When you run kwcreatechecker, the checkers.xml file is created in the <CHECKER.CODE> directory that you specified with the --code option.

The table below provides more information about the elements in the checkers.xml file:

Element Default value Modify? (Yes/No) Description
<checkers version> 1.3 No This version reflects the current Klocwork checker version in use. The value is 1.3 and should NOT be modified.
<categories> not applicable No Refers to how an issue is categorized. The highest-level category is by language. See <category name> below.
<category name> Java Yes Indicates that the checker is a Java checker. You can change this value or remove the element to categorize your custom checker differently. Issue categories are visible in the Configuration Editor for the server project or the desktop project. The Configuration Editor is where you turn issues on or off for analysis. See Configuring checkers for the integration build analysis.
<category name> Custom checkers Yes If you want your checker to be in a category other than "Custom checkers", you can modify the category name. See <category name> above for more information about category names.
<error id> <CHECKER.CODE> No Reflects the issue code you specified with the --code option of kwcreatechecker. When you want to rename your checker, you should recreate the checker files, specifying the new name. Then copy the pertinent data over to the new files. See Don't edit the name of the Path checker.
<checkergroup language> Java No Indicates that the checker is for Java programs
<api> path No Reflects the checker type you specified with the --type <common or kast> option of kwcreatechecker. Common refers to Path. The KAST type displays as tree_pattern.
<checkerclass> See "Description" No Auto-populated values are:
  • com.klocwork.jdefects.checkers.dfa.sourcesink.SVChecker
  • com.klocwork.jdefects.checkers.dfa.sourcesink.RLKChecker
  • com.klocwork.jdefects.checkers.dfa.sourcesink.SourceSinkChecker Note: The SourceSinkChecker value indicates a common path checker.
<error id> <CHECKER.CODE> No This ID appears in the analysis results if an issue is detected by this checker.
<message> "Your message goes here " Yes Provide the message (along with the relevant parameter) you want displayed in the analysis results when an issue is detected by this checker. For example, "JNDI data {0} leak ". Possible parameter values are:
  • {0} sink description
  • {1} source description
  • {2} sink expression source code (note it can be the same as {0})
  • {3} source expression source code (note it can be the same as {1})
<title> "Your title goes here" Yes The checker title appears in the Configuration Editor. For example, "JNDI information leak".
<severity> 4 Yes See Issue severity.
<enabled> true Yes New checkers are enabled by default, but you can disable them by changing the value to false. The Configuration Editor (available for Klocwork Server projects and desktop projects) provides a simple way of enabling or disabling multiple checkers for a project.
<parameter name = "kbsection" value="CHECKER.CODE>.jkb> kbsection No The parameter name and value bind the checker to a specific knowledge base file. The value reflects the name of the knowledge base file.