SonarQube - 如何查看超过前 15 次违规? [英] SonarQube - How to see more than the first 15 violations?

查看:34
本文介绍了SonarQube - 如何查看超过前 15 次违规?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SonarQube 5.3.我们的代码库中有 241k 个问题.但是当我过滤掉主要"问题并单击规则"框以查看违反了哪些规则时,我只能看到前 15 个.有什么方法可以找出所有这些问题吗?

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?

我已编辑此问题以添加屏幕截图.请注意左侧规则"下方只有 15 个.

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

推荐答案

您不能在 UI 中执行此操作,但您可以使用 Web API 获取所需的数据:/api/issues/search(记录在这里)可以列出给定项目的所有问题(使用projectKeys).对于您的问题:将 facets 参数设置为 rules ,然后返回的 JSON 将列出违反的规则(甚至计算每个规则的违反情况).

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).

git 项目为例这里是一个 Web API 请求的例子:

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

编辑:通过 Web API,facet 仍然限于前 15 个元素.但是,可以通过编程方式循环处理问题(结果是分页的)并在此过程中计算规则.

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.

这篇关于SonarQube - 如何查看超过前 15 次违规?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆