From: Jean-Baptiste Lievremont Date: Thu, 10 Apr 2014 13:37:49 +0000 (+0200) Subject: SONAR-5214 Remove references to deprecated violations_density metric X-Git-Tag: 4.3~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c405115c4122838e363f106fddbc92673221e9c7;p=sonarqube.git SONAR-5214 Remove references to deprecated violations_density metric --- diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectTimeMachineDashboard.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectTimeMachineDashboard.java index 18834e6e2f1..ae4f75d12e1 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectTimeMachineDashboard.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/ProjectTimeMachineDashboard.java @@ -39,6 +39,7 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { private static final String METRIC5 = "metric5"; private static final String METRIC6 = "metric6"; private static final String METRIC7 = "metric7"; + private static final String METRIC8 = "metric8"; @Override public String getName() { @@ -57,7 +58,7 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { private void addFirstColumn(Dashboard dashboard) { Widget timelineWidget = dashboard.addWidget("timeline", 1); timelineWidget.setProperty(METRIC1, CoreMetrics.COMPLEXITY_KEY); - timelineWidget.setProperty(METRIC2, CoreMetrics.VIOLATIONS_DENSITY_KEY); + timelineWidget.setProperty(METRIC2, CoreMetrics.TECHNICAL_DEBT_KEY); timelineWidget.setProperty(METRIC3, CoreMetrics.COVERAGE_KEY); Widget sizeTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard); @@ -85,12 +86,11 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { private void addSecondColumn(Dashboard dashboard) { Widget rulesTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard); rulesTimeMachineWidget.setProperty(METRIC1, CoreMetrics.VIOLATIONS_KEY); - rulesTimeMachineWidget.setProperty(METRIC2, CoreMetrics.VIOLATIONS_DENSITY_KEY); - rulesTimeMachineWidget.setProperty(METRIC3, CoreMetrics.BLOCKER_VIOLATIONS_KEY); - rulesTimeMachineWidget.setProperty(METRIC4, CoreMetrics.CRITICAL_VIOLATIONS_KEY); - rulesTimeMachineWidget.setProperty(METRIC5, CoreMetrics.MAJOR_VIOLATIONS_KEY); - rulesTimeMachineWidget.setProperty(METRIC6, CoreMetrics.MINOR_VIOLATIONS_KEY); - rulesTimeMachineWidget.setProperty(METRIC7, CoreMetrics.INFO_VIOLATIONS_KEY); + rulesTimeMachineWidget.setProperty(METRIC2, CoreMetrics.BLOCKER_VIOLATIONS_KEY); + rulesTimeMachineWidget.setProperty(METRIC3, CoreMetrics.CRITICAL_VIOLATIONS_KEY); + rulesTimeMachineWidget.setProperty(METRIC4, CoreMetrics.MAJOR_VIOLATIONS_KEY); + rulesTimeMachineWidget.setProperty(METRIC5, CoreMetrics.MINOR_VIOLATIONS_KEY); + rulesTimeMachineWidget.setProperty(METRIC6, CoreMetrics.INFO_VIOLATIONS_KEY); rulesTimeMachineWidget.setProperty(METRIC7, CoreMetrics.WEIGHTED_VIOLATIONS_KEY); Widget complexityTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard); @@ -107,7 +107,7 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { testsTimeMachineWidget.setProperty(METRIC5, CoreMetrics.TEST_FAILURES_KEY); testsTimeMachineWidget.setProperty(METRIC6, CoreMetrics.TEST_ERRORS_KEY); testsTimeMachineWidget.setProperty(METRIC7, CoreMetrics.TESTS_KEY); - testsTimeMachineWidget.setProperty(METRIC7, CoreMetrics.TEST_EXECUTION_TIME_KEY); + testsTimeMachineWidget.setProperty(METRIC8, CoreMetrics.TEST_EXECUTION_TIME_KEY); } private Widget addTimeMachineWidgetOnFirstColumn(Dashboard dashboard) { diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java index 508925942af..6ce87b3be75 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java @@ -26,7 +26,7 @@ import org.sonar.api.web.WidgetPropertyType; @WidgetProperties({ @WidgetProperty(key = "sizeMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.NCLOC_KEY, options = {WidgetConstants.FILTER_OUT_NEW_METRICS}), - @WidgetProperty(key = "colorMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.VIOLATIONS_DENSITY_KEY, + @WidgetProperty(key = "colorMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.COVERAGE_KEY, options = {WidgetConstants.FILTER_OUT_NEW_METRICS, "type:PERCENT,RATING,LEVEL"}), @WidgetProperty(key = "heightInPercents", type = WidgetPropertyType.INTEGER, optional = true, defaultValue = "55") }) diff --git a/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java b/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java index 0c28124c480..caa02568abc 100644 --- a/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java +++ b/sonar-server/src/main/java/org/sonar/server/ui/DefaultPages.java @@ -97,7 +97,7 @@ public final class DefaultPages { @NavigationSection(NavigationSection.RESOURCE_TAB) @DefaultTab( - metrics = {CoreMetrics.VIOLATIONS_DENSITY_KEY, CoreMetrics.WEIGHTED_VIOLATIONS_KEY, CoreMetrics.VIOLATIONS_KEY, CoreMetrics.BLOCKER_VIOLATIONS_KEY, + metrics = {CoreMetrics.WEIGHTED_VIOLATIONS_KEY, CoreMetrics.VIOLATIONS_KEY, CoreMetrics.BLOCKER_VIOLATIONS_KEY, CoreMetrics.CRITICAL_VIOLATIONS_KEY, CoreMetrics.MAJOR_VIOLATIONS_KEY, CoreMetrics.MINOR_VIOLATIONS_KEY, CoreMetrics.INFO_VIOLATIONS_KEY, CoreMetrics.NEW_VIOLATIONS_KEY, CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, CoreMetrics.NEW_MAJOR_VIOLATIONS_KEY, CoreMetrics.NEW_MINOR_VIOLATIONS_KEY, CoreMetrics.NEW_INFO_VIOLATIONS_KEY,