aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-01-12 18:30:40 +0100
committerFabrice Bellingard <bellingard@gmail.com>2012-01-12 18:40:45 +0100
commitc82a64fb8ea2dc4b031dd1bb5e766c846fdbd443 (patch)
treee431daf56f84d610736a6500ed3c4e3bf2d5abc0 /sonar-plugin-api/src
parentd9336198cba4299a3fd2f0b911c9ce06a6514009 (diff)
downloadsonarqube-c82a64fb8ea2dc4b031dd1bb5e766c846fdbd443.tar.gz
sonarqube-c82a64fb8ea2dc4b031dd1bb5e766c846fdbd443.zip
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
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java96
1 files changed, 96 insertions, 0 deletions
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
@@ -1400,6 +1401,101 @@ public final class CoreMetrics {
//--------------------------------------------------------------------------------------------------------------------
//
+ // 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
//
//--------------------------------------------------------------------------------------------------------------------