SonarQube - How to see more than the first 15 violations?

前端 未结 1 398
渐次进展
渐次进展 2021-01-22 13:48

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 c

相关标签:
1条回答
  • 2021-01-22 14:37

    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.

    0 讨论(0)
提交回复
热议问题