Query to get all the issues for the project and branch

Hi,

I am using SonarQube 8.4.1.
I am trying to query the SonarQube database built in MS SQL while setup.
I am trying to get all the issues for the specific branch form SonarQube Database, but I could not able to find the relation b/w table [issues] and [project_branches].
Is there any way I can relate it. Pls help.

My Query:


SELECT * FROM [Sonar].[dbo].[issues] A WHERE [project_uuid] = 'AXdipD_NY7hCULFc3iP2'

– Where AXdipD_NY7hCULFc3iP2 is my project id from table [projects]

I also need condition with respect to specific branch. I dont want to use API for now. I need this info for some purpose.

Thanks in advance.

Hey there.

We do not recommend directly querying the SonarQube database (and could not provide support in doing so). The most sensible way to pull information out of SonarQube is to use the Web API (documentation linked in the footer of your instance).

Specifically, you probably want to look at the api/issues domain of Web APIs, including GET api/issues/search.

You might also find this guide useful:

I have installed sonar qube 10.1, with java jdk 17 , for visual Studio 2022 .net core 6 c# and after done all the installation when i run it so analyising is done but Code Coverage showing 0.0% as i uploaded screenshot of the page below.

need help for code coverage, how to get code coverage of the project. As i have written testcases also, and installed coverlet package with 2 more pacakages for analysis

Hey @Lalit_Dwiwedi

Feel free to create your own thread, but don’t hijack this one.