aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-12-07 17:02:40 +0100
committerFabrice Bellingard <bellingard@gmail.com>2011-12-07 17:02:40 +0100
commit1a99ebdb1bf1ae481a51bd28657ce37a9d966825 (patch)
tree40042c484b36d6a45216b617987f04d9c10aa3d4
parentb803e6d8792fa523c49d63d5393da6157c3c56f2 (diff)
downloadsonarqube-1a99ebdb1bf1ae481a51bd28657ce37a9d966825.tar.gz
sonarqube-1a99ebdb1bf1ae481a51bd28657ce37a9d966825.zip
SONAR-3057 Use appropriate colors for measures
Differential measures on violation & duplication related metrics should be displayed with red or green colors.
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java26
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb4
2 files changed, 16 insertions, 14 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 263e6fe2765..1e890f7a958 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
@@ -885,6 +885,7 @@ public final class CoreMetrics {
public static final Metric DUPLICATED_LINES = new Metric.Builder(DUPLICATED_LINES_KEY, "Duplicated lines", Metric.ValueType.INT)
.setDescription("Duplicated lines")
.setDirection(Metric.DIRECTION_WORST)
+ .setQualitative(true)
.setDomain(DOMAIN_DUPLICATION)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -894,6 +895,7 @@ public final class CoreMetrics {
public static final Metric DUPLICATED_BLOCKS = new Metric.Builder(DUPLICATED_BLOCKS_KEY, "Duplicated blocks", Metric.ValueType.INT)
.setDescription("Duplicated blocks")
.setDirection(Metric.DIRECTION_WORST)
+ .setQualitative(true)
.setDomain(DOMAIN_DUPLICATION)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1025,7 +1027,7 @@ public final class CoreMetrics {
public static final Metric VIOLATIONS = new Metric.Builder(VIOLATIONS_KEY, "Violations", Metric.ValueType.INT)
.setDescription("Violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1035,7 +1037,7 @@ public final class CoreMetrics {
public static final Metric BLOCKER_VIOLATIONS = new Metric.Builder(BLOCKER_VIOLATIONS_KEY, "Blocker violations", Metric.ValueType.INT)
.setDescription("Blocker violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1045,7 +1047,7 @@ public final class CoreMetrics {
public static final Metric CRITICAL_VIOLATIONS = new Metric.Builder(CRITICAL_VIOLATIONS_KEY, "Critical violations", Metric.ValueType.INT)
.setDescription("Critical violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1055,7 +1057,7 @@ public final class CoreMetrics {
public static final Metric MAJOR_VIOLATIONS = new Metric.Builder(MAJOR_VIOLATIONS_KEY, "Major violations", Metric.ValueType.INT)
.setDescription("Major violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1065,7 +1067,7 @@ public final class CoreMetrics {
public static final Metric MINOR_VIOLATIONS = new Metric.Builder(MINOR_VIOLATIONS_KEY, "Minor violations", Metric.ValueType.INT)
.setDescription("Minor violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1075,7 +1077,7 @@ public final class CoreMetrics {
public static final Metric INFO_VIOLATIONS = new Metric.Builder(INFO_VIOLATIONS_KEY, "Info violations", Metric.ValueType.INT)
.setDescription("Info violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1085,7 +1087,7 @@ public final class CoreMetrics {
public static final Metric NEW_VIOLATIONS = new Metric.Builder(NEW_VIOLATIONS_KEY, "New Violations", Metric.ValueType.INT)
.setDescription("New Violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1095,7 +1097,7 @@ public final class CoreMetrics {
public static final Metric NEW_BLOCKER_VIOLATIONS = new Metric.Builder(NEW_BLOCKER_VIOLATIONS_KEY, "New Blocker violations", Metric.ValueType.INT)
.setDescription("New Blocker violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1105,7 +1107,7 @@ public final class CoreMetrics {
public static final Metric NEW_CRITICAL_VIOLATIONS = new Metric.Builder(NEW_CRITICAL_VIOLATIONS_KEY, "New Critical violations", Metric.ValueType.INT)
.setDescription("New Critical violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1115,7 +1117,7 @@ public final class CoreMetrics {
public static final Metric NEW_MAJOR_VIOLATIONS = new Metric.Builder(NEW_MAJOR_VIOLATIONS_KEY, "New Major violations", Metric.ValueType.INT)
.setDescription("New Major violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1125,7 +1127,7 @@ public final class CoreMetrics {
public static final Metric NEW_MINOR_VIOLATIONS = new Metric.Builder(NEW_MINOR_VIOLATIONS_KEY, "New Minor violations", Metric.ValueType.INT)
.setDescription("New Minor violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
@@ -1135,7 +1137,7 @@ public final class CoreMetrics {
public static final Metric NEW_INFO_VIOLATIONS = new Metric.Builder(NEW_INFO_VIOLATIONS_KEY, "New Info violations", Metric.ValueType.INT)
.setDescription("New Info violations")
.setDirection(Metric.DIRECTION_WORST)
- .setQualitative(false)
+ .setQualitative(true)
.setDomain(DOMAIN_RULES)
.setBestValue(0.0)
.setOptimizedBestValue(true)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
index b5687260693..44468d9516f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
@@ -99,8 +99,8 @@
<% if column.on_metric? && column.metric
measure = @filter_context.measure(snapshot, column.metric)
%>
- <% if column.variation %>
- <%= format_variation(measure, :index => @filter_context.period_index, :style => (column.metric.on_new_code? ? 'none' : 'light')) -%>
+ <% if column.variation || column.metric.on_new_code? %>
+ <%= format_variation(measure, :index => @filter_context.period_index, :style => 'light') -%>
<% else %>
<%= format_measure(measure) -%>
<% if @filter_context.selected_period? %>