通过shields.io徽章添加SonarQube覆盖范围

时间:2017-04-01 20:01:37

标签: sonarqube travis-ci shields.io

6 个答案:

答案 0 :(得分:3)

现在,我不使用http://shields.io,而是直接使用https://sonarcloud.io网站。

[![Quality Gate](https://sonarcloud.io/api/badges/gate?key=com.github.noraui:noraui)](https://sonarcloud.io/dashboard/index/com.github.noraui:noraui)
[![SonarCloud Coverage](https://sonarcloud.io/api/badges/measure?key=com.github.noraui%3Anoraui&metric=coverage)](https://sonarcloud.io/component_measures/metric/coverage/list?id=com.github.noraui:noraui)
[![SonarCloud Bugs](https://sonarcloud.io/api/badges/measure?key=com.github.noraui%3Anoraui&metric=bugs)](https://sonarcloud.io/component_measures/metric/reliability_rating/list?id=com.github.noraui%3Anoraui)
[![SonarCloud Vulnerabilities](https://sonarcloud.io/api/badges/measure?key=com.github.noraui%3Anoraui&metric=vulnerabilities)](https://sonarcloud.io/component_measures/metric/security_rating/list?id=com.github.noraui%3Anoraui)

Quality Gate SonarCloud Coverage SonarCloud Bugs SonarCloud Vulnerabilities

答案 1 :(得分:2)

2018年6月更新...

API已于2018年初弃用,并已在April 2018中删除。

当前在项目较低的RHS上有一个链接“ 获取项目徽章”,其中显示了度量标准的可用图像URL。

答案 2 :(得分:1)

我刚发现这个问题,因为我也试图从sonarqube获取徽章(在我的情况下是sonarcloud)。

徽章有嵌入式API。 这是官方文档(我有时间在谷歌上找到它):https://next.sonarqube.com/sonarqube/web_api/api/badges

遗憾的是,

http://shields.io不再与sonarqube合作。

答案 3 :(得分:1)

SonarCloud.io将API更改为这些URL

https://sonarcloud.io/api/project_badges/quality_gate?project=WcfSoapLogger&branch=master
https://sonarcloud.io/api/project_badges/measure?project=WcfSoapLogger&metric=code_smells

答案 4 :(得分:1)

新API。

 [![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=metamug_mason&metric=alert_status)](https://sonarcloud.io/dashboard?id=metamug_mason) 
 [![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=metamug_mason&metric=coverage)](https://sonarcloud.io/component_measures/metric/coverage/list?id=metamug_mason)
 [![SonarCloud Bugs](https://sonarcloud.io/api/project_badges/measure?project=metamug_mason&metric=bugs)](https://sonarcloud.io/component_measures/metric/reliability_rating/list?id=metamug_mason)
 [![SonarCloud Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=metamug_mason&metric=vulnerabilities)](https://sonarcloud.io/component_measures/metric/security_rating/list?id=metamug_mason)

Sonarcloud Status SonarCloud Coverage  SonarCloud Bugs  SonarCloud Vulnerabilities

答案 5 :(得分:1)

https://github.com/030/nexus3-cli

[![Build Status](https://travis-ci.org/030/nexus3-cli.svg?branch=master)](https://travis-ci.org/030/nexus3-cli)
[![Go Report Card](https://goreportcard.com/badge/github.com/030/nexus3-cli)](https://goreportcard.com/report/github.com/030/nexus3-cli)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=bugs)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=code_smells)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=coverage)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=ncloc)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=security_rating)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=sqale_index)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=030_nexus3-cli&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=030_nexus3-cli)

目前似乎有11个徽章。

Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Quality Gate Status Reliability Rating Security Rating Technical Debt Vulnerabilities