From c82a64fb8ea2dc4b031dd1bb5e766c846fdbd443 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 12 Jan 2012 18:30:40 +0100 Subject: SONAR-3012 New widget to monitor the review activity - 5 new metrics added - Decorator implemented to compute those metrics - Widget implemented to report those metrics --- .../java/org/sonar/api/measures/CoreMetrics.java | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) (limited to 'sonar-plugin-api/src') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java index 824aab6bdc8..01b28da154e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java @@ -43,6 +43,7 @@ public final class CoreMetrics { public static final String DOMAIN_DOCUMENTATION = "Documentation"; public static final String DOMAIN_RULES = "Rules"; public static final String DOMAIN_SCM = "SCM"; + public static final String DOMAIN_REVIEWS = "Reviews"; /** * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007 @@ -1398,6 +1399,101 @@ public final class CoreMetrics { .create(); + //-------------------------------------------------------------------------------------------------------------------- + // + // REVIEWS (since 2.14) + // + //-------------------------------------------------------------------------------------------------------------------- + + /** + * @since 2.14 + */ + public static final String VIOLATIONS_WITHOUT_REVIEW_KEY = "violations_without_review"; + + /** + * @since 2.14 + */ + public static final Metric VIOLATIONS_WITHOUT_REVIEW = new Metric.Builder(VIOLATIONS_WITHOUT_REVIEW_KEY, "Unreviewed violations", Metric.ValueType.INT) + .setDescription("Violations that have not been reviewed yet") + .setDirection(Metric.DIRECTION_WORST) + .setDomain(DOMAIN_REVIEWS) + .setBestValue(0.0) + .setOptimizedBestValue(true) + .setFormula(new SumChildValuesFormula(false)) + .create(); + + /** + * @since 2.14 + */ + public static final String FALSE_POSITIVE_REVIEWS_KEY = "false_positive_reviews"; + + /** + * @since 2.14 + */ + public static final Metric FALSE_POSITIVE_REVIEWS = new Metric.Builder(FALSE_POSITIVE_REVIEWS_KEY, "False-positive reviews", Metric.ValueType.INT) + .setDescription("Active false-positive reviews") + .setDirection(Metric.DIRECTION_WORST) + .setDomain(DOMAIN_REVIEWS) + .setBestValue(0.0) + .setOptimizedBestValue(true) + .setFormula(new SumChildValuesFormula(false)) + .create(); + + /** + * @since 2.14 + */ + public static final String ACTIVE_REVIEWS_KEY = "active_reviews"; + + /** + * @since 2.14 + */ + public static final Metric ACTIVE_REVIEWS = new Metric.Builder(ACTIVE_REVIEWS_KEY, "Active reviews", Metric.ValueType.INT) + .setDescription("Active open and reopened reviews") + .setDirection(Metric.DIRECTION_WORST) + .setDomain(DOMAIN_REVIEWS) + .setBestValue(0.0) + .setOptimizedBestValue(true) + .setFormula(new SumChildValuesFormula(false)) + .create(); + + /** + * @since 2.14 + */ + public static final String UNASSIGNED_REVIEWS_KEY = "unassigned_reviews"; + + /** + * @since 2.14 + */ + public static final Metric UNASSIGNED_REVIEWS = new Metric.Builder(UNASSIGNED_REVIEWS_KEY, "Unassigned reviews", Metric.ValueType.INT) + .setDescription("Active unassigned reviews") + .setDirection(Metric.DIRECTION_WORST) + .setDomain(DOMAIN_REVIEWS) + .setBestValue(0.0) + .setOptimizedBestValue(true) + .setFormula(new SumChildValuesFormula(false)) + .create(); + + /** + * @since 2.14 + */ + public static final String UNPLANNED_REVIEWS_KEY = "unplanned_reviews"; + + /** + * @since 2.14 + */ + public static final Metric UNPLANNED_REVIEWS = new Metric.Builder(UNPLANNED_REVIEWS_KEY, "Unplanned reviews", Metric.ValueType.INT) + .setDescription("Active unplanned reviews") + .setDirection(Metric.DIRECTION_WORST) + .setDomain(DOMAIN_REVIEWS) + .setBestValue(0.0) + .setOptimizedBestValue(true) + .setFormula(new SumChildValuesFormula(false)) + .create(); + + + + + //-------------------------------------------------------------------------------------------------------------------- // // OTHERS -- cgit v1.2.3