Kwcheck output referenceDefault outputEach line in the kwcheck plain-text output contains at least the following fields: <issue_ID> (System:<system_ID>) <origin> <file>:<line_number> <issue_code> (<severity_number>:<severity_label>) <status> <message> where
Example: 5 (Local) C:\zlib\trees.c:777 ABR (1:Critical) Analyze Buffer overflow, array index of 'bl_tree' may be out of bounds. Array 'bl_tree' of size 39 may use index value(s) 39..65535. Also there are 2 similar errors on line(s) 777. Detailed outputUse -F detailed with kwcheck list or with kwcheck run to get traceback and comment details about detected issues. <local_ID> (System:<system_ID>) <origin> <file>:<line_number> <issue_code> (<severity_number>:<severity label>) <status> <message> <traceback_lines> <issue_status> <comment> Example: 5 (System: 22) /testing/myproj/trees.c:777 ABR (1:Critical) Fix Buffer overflow, array index of 'bl_tree' may be out of bounds. Array 'bl_tree' of size 39 may use index value(s) 39..65535. Also there are 2 similar errors on line(s) 777. * foo.c:760: ...:=tree[0] .dl.len * foo.c:768: n<=max_code is true * foo.c:769: ...:=tree[n+1] .dl.len * foo.c:769: curlen:=nextlen * foo.c:789: nextlen==0 is false * foo.c:776: curlen!=prevlen is true * foo.c:777: The array 'bl_tree' size is 39. * deflate.h:194: The array 'bl_foo' size is 39. * foo.c:777: Array 'bl_foo' may use the 39..65535 index. Current status 'Fix' Comment:Needs to be fixed immediately XML outputUse -F xml with kwcheck list or kwcheck run to generate XML output. XML output example<?xml version="1.0" encoding="UTF-8" ?> - <errorList xmlns="http://www.klocwork.com/inForce/report/1.0"> - <problem> <problemID>3</problemID> <isSystem>true</isSystem> <file>/space/temp/b1.cc</file> <method>bar</method> <code>LV_UNUSED.GEN</code> <message>Local variable 'm' is never used</message> <citingStatus>Analyze</citingStatus> <owner>unowned</owner> <severity>Review</severity> <severitylevel>4</severitylevel> <displayAs>Warning</displayAs> - <taxonomies> <taxonomy name="C and C++" metaInf="" /> <taxonomy name="alpha" metaInf="" /> <taxonomy name="tax1" metaInf="" /> </taxonomies> </problem> - <problem> <problemID>4</problemID> <file>/space/temp/b1.cc</file> <method>main</method> <code>UNREACH.GEN</code> <message>Code is unreachable</message> <citingStatus>Analyze</citingStatus> <owner>unowned</owner> <severity>Review</severity> <severitylevel>4</severitylevel> <displayAs>Error</displayAs> - <taxonomies> <taxonomy name="C and C++" metaInf="" /> <taxonomy name="alpha" metaInf="" /> </taxonomies> </problem> </errorList> XML output file formatThe XML Klocwork output contains one <errorList> element with zero or more <problem> elements inside. Each problem description contains the following tags:
Error message fields for metric threshold violationsThe error message field for metric threshold violations contains these additional fields: <issue_ID> <file>: <line> <metric> <status> Violated metric "<description>": <entity> <real_value> <operation> <threshold> where
Example: 6 (Local) /test_files/TC00000192.c:3 METRICS.E.cyclomatic_complexity Analyze Violated metric "cyclomaticcomplexity": foo1 21>20 The output indicates that the file TC00000192.c in line 3 violates the metric for Cyclomatic Complexity. The violation occurred because foo1 has a complexity rating of 21, which is higher than the threshold of 20. |