Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for static and dynamic analyzer tools.
https://codechecker.readthedocs.io
Apache License 2.0
2.28k stars 383 forks source link

Plist Output CSA 'type' field missing #3793

Open schrc3b6 opened 2 years ago

schrc3b6 commented 2 years ago

Hi,

I'm currently switching from scan-build to CodeChecker, great tool btw :) However, I'm noticing that 'type' field from the plist reports the CSA generates is missing in the final plist reports. Is there a reason for removing this field? I'm currently using the error-type field in post-processing.

Thanks

whisperity commented 2 years ago

Could you please show a small example of what this field may contain? It is very well possible that the output format of CSA changed and we did not pick up on this fact.

schrc3b6 commented 2 years ago

The CSA provides for example the following fields:

   <key>description</key><string>Potential leak of memory pointed to by &apos;newItem&apos;</string>
   <key>category</key><string>Memory error</string>
   <key>type</key><string>Memory leak</string>
   <key>check_name</key><string>unix.Malloc</string>

The created by codechecker is missing the type field:

            <key>category</key>
            <string>Memory error</string>
            <key>check_name</key>
            <string>unix.Malloc</string>
            <key>description</key>
            <string>Potential leak of memory pointed to by 'newItem'</string>

Here is another example: CSA:

   <key>description</key><string>Use of memory after it is freed</string>
   <key>category</key><string>Memory error</string>
   <key>type</key><string>Use-after-free</string>
   <key>check_name</key><string>unix.Malloc</string>

CodeChecker:

            <key>category</key>
            <string>Memory error</string>
            <key>check_name</key>
            <string>unix.Malloc</string>
            <key>description</key>
            <string>Use of memory after it is freed</string>

The type field contains the error type. Which I use in post-processing to extend error messages and modify the severity. Since a single checker provides multiple error types, as seen above, is relying on the check_name suboptimal.