Open aallrd opened 2 years ago
I compared the plist reports from the Clang SA from CodeChecker and scan-build on the same source file.
The reports show the same diagnostic but the CodeChecker one is missing the extended_message
key:
CodeChecker generated plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>diagnostics</key>
<array>
<dict>
<key>category</key>
<string>Unused code</string>
<key>check_name</key>
<string>deadcode.DeadStores</string>
<key>description</key>
<string>Value stored to 'pc' is never read</string>
<key>issue_hash_content_of_line_in_context</key>
<string>7158da36ad0e68ee70a4dcadca396eed</string>
<key>location</key>
<dict>
<key>col</key>
<integer>7</integer>
<key>file</key>
<integer>0</integer>
<key>line</key>
<integer>130</integer>
</dict>
<key>path</key>
<array>
<dict>
<key>depth</key>
<integer>0</integer>
<key>kind</key>
<string>event</string>
<key>location</key>
<dict>
<key>col</key>
<integer>7</integer>
<key>file</key>
<integer>0</integer>
<key>line</key>
<integer>130</integer>
</dict>
<key>message</key>
<string>Value stored to 'pc' is never read</string>
<key>range</key>
<array>
<dict>
<key>col</key>
<integer>13</integer>
<key>file</key>
<integer>0</integer>
<key>line</key>
<integer>130</integer>
</dict>
<dict>
<key>col</key>
<integer>13</integer>
<key>file</key>
<integer>0</integer>
<key>line</key>
<integer>130</integer>
</dict>
</array>
</dict>
</array>
</dict>
</array>
<key>files</key>
<array>
<string>/source.c</string>
</array>
<key>metadata</key>
<dict>
<key>analyzer</key>
<dict>
<key>name</key>
<string>clangsa</string>
</dict>
<key>generated_by</key>
<dict>
<key>name</key>
<string>CodeChecker</string>
<key>version</key>
<string>6.18.0</string>
</dict>
</dict>
</dict>
</plist>
scan-build generated plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>clang_version</key>
<string>clang version 13.0.0</string>
<key>diagnostics</key>
<array>
<dict>
<key>path</key>
<array>
<dict>
<key>kind</key><string>event</string>
<key>location</key>
<dict>
<key>line</key><integer>130</integer>
<key>col</key><integer>7</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ranges</key>
<array>
<array>
<dict>
<key>line</key><integer>130</integer>
<key>col</key><integer>13</integer>
<key>file</key><integer>0</integer>
</dict>
<dict>
<key>line</key><integer>130</integer>
<key>col</key><integer>13</integer>
<key>file</key><integer>0</integer>
</dict>
</array>
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
<string>Value stored to pc is never read</string>
<key>message</key>
<string>Value stored to pc is never read</string>
</dict>
</array>
<key>description</key><string>Value stored to pc is never read</string>
<key>category</key><string>Unused code</string>
<key>type</key><string>Dead increment</string>
<key>check_name</key><string>deadcode.DeadStores</string>
<!-- This hash is experimental and going to change! -->
<key>issue_hash_content_of_line_in_context</key><string>7158da36ad0e68ee70a4dcadca396eed</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>Sys_ImpMDATE</string>
<key>issue_hash_function_offset</key><string>29</string>
<key>location</key>
<dict>
<key>line</key><integer>130</integer>
<key>col</key><integer>7</integer>
<key>file</key><integer>0</integer>
</dict>
<key>ExecutedLines</key>
<dict>
<key>0</key>
<array>
<integer>130</integer>
</array>
</dict>
</dict>
</array>
<key>files</key>
<array>
<string>/source.c</string>
</array>
</dict>
</plist>
It seems that the CodeChecker plist contains less keys than the scan-build one. Are they filtered somehow?
Could you please share the reproducer c++ file? Also the clang --version would help a lot.
I tried to reconstruct a dead store example according to your first plist, but I still end up having the extended_message
field in the report: https://godbolt.org/z/GTKKajcvY
Hello,
This is going to be a weird issue, because everything works wonderfully well, thank you for CodeChecker š
I am using CodeChecker 6.18.0 on my codeline to run the Clang SA, and I am successfully able to analyze/parse/store the generated report on our CodeChecker server. Some people in my organization are running a SonarQube instance and wanted to experiment if we could push the CodeChecker reports to the Sonar server. Since the CodeChecker analyze output is in the plist format, it seemed like a straightforward task but we got this error when processing the files with Sonar:
I could find examples of plist with this key
extended_message
in the codechecker codeline on Github, but it is not really clear to me if this is a mandatory entry in the report structure (and there is a bug), or it's not mandatory (or deprecated) and Sonar is wrong expecting this key.Do you have a clue maybe?