如何使用语言过滤器从SonarCloud获取指标?

问题描述 投票:0回答:2

我如下所述提到了this page并且可以得到一些值。

$ curl -v "https://sonarcloud.io/api/measures/component?metricKeys=violations&component=key" | jq

但是如何通过语言过滤器获取这些值?

sonarqube sonarcloud
2个回答
0
投票

无法按语言查询项目级指标。正如您在/api/measures/component Web服务的描述中看到的那样,没有language参数。

如果您对特定问题感兴趣(我问,因为我发现您正在尝试查询violations指标),那么您应该使用/api/issues/search Web服务,您有language参数。


0
投票

感谢您的评论和回答!这是自我解决的。 我尝试使用-Dsonar.language=c等语言选项进行声纳扫描,之后访问了Web API。通过这样做,我可以获得C代码的价值。

© www.soinside.com 2019 - 2024. All rights reserved.