I am working on a Sonarqube plugin and I want to show some metrics but Sonarqube don't show anything! Here is a metric in the Metric class:
public static final String TC_PRO_KEY = "project-tc";
public static final Metric<Integer> TC_PRO = new Metric.Builder(TC_PRO_KEY, "Project Test Cases",
Metric.ValueType.INT)
.setDescription("Number of Test Cases for the project")
.setDirection(Metric.DIRECTION_BETTER)
.setQualitative(true)
.setDomain(TL_DOMAIN)
.create();
And in the execute() method of the Sensor:
context.<Integer>newMeasure().forMetric(CatcherMetrics.TC_PRO).on(context.module()).withValue(nbTotalTC).save();
Can you tell me if I do someting wrong.
The problem wasn't here! My metrics were with status required and I used Common properties and the fields were empty so there was an error!