Import external defects with kwdefectimport

You can use Kwdefectimport to import a list of external defects into Klocwork. These are defects that were discovered by an external tool or process, independent of Klocwork.

You run Kwdefectimport on the command line at build time after Kwbuildproject and before kwadmin -load. When run, it uses the data in the artifacts (tables and files) that are created by kwbuildproject, then creates new problem data for kwadmin to load.

Importing external defects into Klocwork involves the following steps:

  1. Creating or obtaining a listing of defects. Depending on your implementation, this list can be any format such as a file, a stream, or a port.
  2. Creating a .pconf checker configuration file onto which the defects are mapped to checkers.
  3. Creating a defect parser that implements the interface com.klocwork.defectimport.IDefectParser to parse the defect listing file.
  4. Running kwdefectimport as part of your analysis, after kwbuildproject but before kwadmin -load.