Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a custom metric using Sonar API

I am creating a plugin for Sonar and I need to create a custom metric since there are no core metrics within Sonar API that fulfill my needs.

I need to be able to display this metric on the dashboard.

Any help is greatly appreciated!

like image 784
kidloco Avatar asked Mar 20 '12 13:03

kidloco


1 Answers

You can find examples in the Community plugins for SonarQube project.

For instance, the Sonar Artifact Size Plugin defines some additional metrics. You can see the code in https://github.com/SonarQubeCommunity/sonar-artifact-size/tree/master/src/main/java/org/sonar/plugins/artifactsize

like image 54
Fabrice - SonarSource Team Avatar answered Oct 23 '22 04:10

Fabrice - SonarSource Team