[cmd] parse extends sarif output with extra fields - #4925
Conversation
d96e525 to
8d36e16
Compare
8d36e16 to
e3ec728
Compare
dkrupp
left a comment
There was a problem hiding this comment.
The implementation works nicely, Please check my comments related to the default filters.
| self.__log_and_analyze() | ||
|
|
||
| parse_sarif_cmd = [self._codechecker_cmd, "parse", self.report_dir, | ||
| "-e", "sarif", "--review-status", "false_positive"] |
There was a problem hiding this comment.
For sarif export I think the convenient default would be to export everything into sarif and not just the ['confirmed', 'unreviewed'] reports. For standard command line outptut and possible from html, the current default is meaningful (you dont want to see dismissed reports).
Can you please add a filter option "everything" and make that as the default for sarif export?
This way the users would not need to list all review status possibilities at command line invocation if they want to export everything.
There was a problem hiding this comment.
This will be fixed in a followup TR
There are a few fields in the SARIF specification which would be meaningful to be filled out, but today are not generated into the exported files.
CodeChecker parsealready populates Report objects with review status information, but currently only JSON export makes use of it. This PR addssuppressionobjects to individual results in the SARIF file, according to the spec, including suppression source (source code comment or review config file) and justification message.location.physicalLocationmay be added in a follow-up PR.SARIF
rules[](~checkers) are extended withdefaultConfiguration.levelandhelpUrifields (spec), corresponding to theseverityanddoc_urlchecker labels in CodeChecker config.Note that this only applies to the
CodeChecker parsecommand at the moment, which has the analyzer context (including aCheckerLabelobject) readily available. Doing the same for the standalone report-converter is an orthogonal task, and might entail bigger refactorings.