Export Sonar Qube Report Including bugs, Vulenrabilities, Code Smells, Coverage

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube 7.7, Scanner, Plugin, and any relevant extension)
    *I am trying to get report of all my projects which can be send to developer on daily basis including all bugs, coverege of all projects. I t has to be in one report not seperate.


Why not giving those developers the permission to browse/ query / filter the information ?

We believe the SonarQube UI provides all the flexibility you need and that the tool is designed for developers. It is much better for developers to pull the information they need at the time they need it rather than someone else pushing the information to them.

Now if you really want to extract the data outside of SonarQube (like in csv, excel, odf…), we do not directly provide the reporting feature.
What you could do though, is to take advantage of Web API (api documentation is available from footer pages in your instance).
Web API provides a JSON output, then it will be a matter of converting the JSON into your target format
(Please note SonarQube does not provide such conversion tool)

Creating a report will require some scripting on your side to build your report

In Web API documentation , look up in particular :

GET api/projects/search : to list your projects (output includes the project key)
from there you can iterate over the list and use for example
GET api/issues/search : to list issues for a given project key
GET api/measures/component : to get all kind of measures filter for a specific metric key (like coverage)
(and all potential metrics keys can be listed from GET api/metrics/search)

And the sending on daily basis should be scheduled by something like crontab

Again, having the developers reading all those metrics from the UI , any time they like , is so much simpler than building such script in my opinion…

I hope this helps


Thanks Eric

Mainly this report I wanted to send it to the business on weekly or daily basis in email.
That’s why I was looking for something which can be generated.

Sunil Bindra