如何在 sonarqube 上获得 10,000 多个问题 [英] How to get more than 10,000 issues on sonarqube

查看:61
本文介绍了如何在 sonarqube 上获得 10,000 多个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一项需要生成问题报告并将其导出到 excel 的要求.项目中生成的问题数量超过了 sonarqube API 允许的 10,000 条记录的限制.我想获取所有问题并将它们导出,但是当我尝试获取 10,000 多条记录时,我得到以下响应:

I am working on a requirement where we need to generate issues reports and export them in excel. The number of issues that are generated in the project exceed the limit of 10,000 records that are allowed by sonarqube API. I want to get all the issues and export them but when I try to get more than 10,000 records I get below response:

{
"errors": [
  {
    "msg": "Can return only the first 10000 results. 12000th result asked."
  }
 ]
}

这是有道理的,因为 API 有返回前 10,000 个问题的限制.请求 URL 是 http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120其中 p=pageNumber

This makes sense as the API has a limit to return first 10,000 issues. Request URL is http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120 where p=pageNumber

是否有任何解决方法可以解决所有问题?

Is there any workaround by which I can get all the issues?

推荐答案

当结果超过 10000 个时,获得其余结果的唯一方法是将您的查询拆分为多个、具有更严格过滤器的更精细的查询,例如每个查询返回少于 10000 个结果.然后结合查询结果,得到你完整的目标结果集.

When there are more than 10000 results, the only way to get the rest is to split your query to multiple, more refined queries with more strict filters, such that each query returns less than 10000 results. And then combine the query results to obtain your complete target result set.

此对 10000 个结果的限制适用于由 ElasticSearch 索引支持的 Web 服务,这是没有办法绕过的.

This limitation to 10000 results applies to web services that are backed by ElasticSearch index, and there’s just no way around it.

这篇关于如何在 sonarqube 上获得 10,000 多个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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