metric.alert_status.description=Alert
metric.alert_status.abbreviation=A
+metric.quality_gate_status.name=Quality Gate Status
+metric.quality_gate_status.description=The project status with regard to it's quality thresholds.
+metric.quality_gate_status.abbreviation=QG
+
metric.classes.name=Classes
metric.classes.description=Classes
*/
public final class CoreMetrics {
- private CoreMetrics() {
- // only static stuff
- }
-
// the following fields are not final to avoid compile-time constants used by plugins
public static String DOMAIN_SIZE = "Size";
public static String DOMAIN_TESTS = "Tests";
.setDomain(DOMAIN_GENERAL)
.create();
+ public static final String QUALITY_GATE_STATUS_KEY = "quality_gate_status";
+ public static final Metric QUALITY_GATE_STATUS = new Metric.Builder(QUALITY_GATE_STATUS_KEY, "Quality Gate Status", Metric.ValueType.LEVEL)
+ .setDescription("The project status with regard to it's quality thresholds.")
+ .setDirection(Metric.DIRECTION_BETTER)
+ .setQualitative(true)
+ .setDomain(DOMAIN_GENERAL)
+ .create();
+
public static final String PROFILE_KEY = "profile";
public static final Metric PROFILE = new Metric.Builder(PROFILE_KEY, "Profile", Metric.ValueType.DATA)
.setDescription("Selected quality profile")
}
}
+ private CoreMetrics() {
+ // only static stuff
+ }
+
public static List<Metric> getMetrics() {
return METRICS;
}
@Test
public void shouldReadMetricsFromClassReflection() {
List<Metric> metrics = CoreMetrics.getMetrics();
- assertThat(metrics).hasSize(150);
+ assertThat(metrics).hasSize(151);
assertThat(metrics).contains(CoreMetrics.NCLOC, CoreMetrics.DIRECTORIES);
}
}