我如下所述提到了this page并且可以得到一些值。
$ curl -v "https://sonarcloud.io/api/measures/component?metricKeys=violations&component=key" | jq
但是如何通过语言过滤器获取这些值?
无法按语言查询项目级指标。正如您在/api/measures/component
Web服务的描述中看到的那样,没有language
参数。
如果您对特定问题感兴趣(我问,因为我发现您正在尝试查询violations
指标),那么您应该使用/api/issues/search
Web服务,您有language
参数。
感谢您的评论和回答!这是自我解决的。
我尝试使用-Dsonar.language=c
等语言选项进行声纳扫描,之后访问了Web API。通过这样做,我可以获得C代码的价值。