It is possible to get a report of the analysis with full issue details (number of issues, types, lines of code, …), but I don’t know if it is in the format expected by Jenkins.
We also use Jenkins and we don’t use its Sonar plugin but rather have a custom script that performs the analysis and sets a Gerrit score.
- In order to get the report, take a look at the
report-task.txt file generated by the scanner after it has finished. You first need to check that the server hea finished to process the analysis by downloading the URL of
The file looks like this:
Keep downloading the
ceTaskUrl file until the status shows
SUCCESS (you can query this JSON file using the jq utility).
Once the server finished processing the analysis, you can download your report by querying the server using the Web API. The right API is
/api/issues. The URL you should download is something like this:
This is I think the file you are looking for. It contains all issues with the comments that appear on Sonar. We only use it to set the score, but it is possible to extract the comments using jq and send the comments to Gerrit.