SonarQube - How to see more than the first 15 viol

2019-02-26 07:01发布

I'm using SonarQube 5.3. We have 241k issues in our codebase. But when I filter out say, the "Major" issues and click on the "Rule" box to see what rules were violated, I can only see the first 15. Is there a way I can find out all of them?

I've edited this question to add a screenshot. Notice on the left under "Rule" there are only 15 of them.

enter image description here

标签: sonarqube
1条回答
ゆ 、 Hurt°
2楼-- · 2019-02-26 07:26

You can't do this in the UI, but you can get the data you need using the Web API: /api/issues/search (documented here) can list all the issues of a given project (use projectKeys). And to your question: set the facets parameter to rules , the returned JSON will then list the violated rules (and even count the violations per rule).

Using git project as an example here's an example of Web API request:

https://sonarqube.com/api/issues/search?projectKeys=git&severities=CRITICAL&facets=rules&ps=250

Edit: via Web API, facet is still limited to top 15 elements. However one can programmatically loop through issues (results are paginated) and count rules along the way.

查看更多
登录 后发表回答