baohuy91 / sonar-custom-metric-plugin

SonarQube custom metric plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SonarQube Custom Metric Plugin

Quality Gate Coverage Bug

This is a custom plugin for Sonarqube - Continuous code quality inspection tool.

This plugin will allow to add custom metrics project to let quality gate checking for it.

Install plugin

Copy the built Jar plugin to Sonarqube server plugin directory in <Sonarqube home>/extensions/plugins/. Restart the Sonarqube server

Sonarqube on Docker If you are using Docker compose file, copy the plugin to the container volume:

// sonarqube_sonarqube_1 is container name
docker cp sonar-customer-metric-plugin-0.1.jar sonarqube_sonarqube_1:/opt/sonarqube/extensions/plugins/
docker-compose restart

Custom metric file format

The custom metric we define need to be written down somewhere in the project. The file will have a CSV format

metricId,value
myMetricInt1,1
myMetricStr2,good

the metricId should be defined in this plugin. value could be various from int, double to string. It will be parsed depend on the value type of metric we defined in this plugin.

About

SonarQube custom metric plugin


Languages

Language:Java 100.0%