diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-12-14 10:27:35 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-12-14 15:10:52 +0100 |
commit | 82e46483e92936aeede1aef0e8658937e0fbf1e1 (patch) | |
tree | 0665a822c417e37e723e7d4958b344001bfa1b68 /plugins | |
parent | b65a688104ad5ba6ef9db5033d173feaa4953f94 (diff) | |
download | sonarqube-82e46483e92936aeede1aef0e8658937e0fbf1e1.tar.gz sonarqube-82e46483e92936aeede1aef0e8658937e0fbf1e1.zip |
Fix violations
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/HotspotsDashboard.java | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/HotspotsDashboard.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/HotspotsDashboard.java index f6625d8854c..f2dc9072cf1 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/HotspotsDashboard.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/dashboards/HotspotsDashboard.java @@ -29,37 +29,41 @@ import org.sonar.api.web.dashboard.Widget; */ public class HotspotsDashboard extends DashboardTemplate { + private static final String HOTSPOT_METRIC = "hotspot_metric"; + private static final String TITLE_PROPERTY = "title"; + private static final String METRIC_PROPERTY = "metric"; + @Override public org.sonar.api.web.dashboard.Dashboard createDashboard() { Dashboard dashboard = Dashboard.createDashboard("sonar-hotspots", "Hotspots", DashboardLayouts.TWO_COLUMNS); Widget widget = dashboard.addWidget("hotspot_most_violated_rules", 1, 1); - widget = dashboard.addWidget("hotspot_metric", 1, 2); - widget.addProperty("metric", "test_execution_time"); - widget.addProperty("title", "Longest unit tests"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 1, 2); + widget.addProperty(METRIC_PROPERTY, "test_execution_time"); + widget.addProperty(TITLE_PROPERTY, "Longest unit tests"); - widget = dashboard.addWidget("hotspot_metric", 1, 3); - widget.addProperty("metric", "complexity"); - widget.addProperty("title", "Highest complexity"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 1, 3); + widget.addProperty(METRIC_PROPERTY, "complexity"); + widget.addProperty(TITLE_PROPERTY, "Highest complexity"); - widget = dashboard.addWidget("hotspot_metric", 1, 4); - widget.addProperty("metric", "duplicated_lines"); - widget.addProperty("title", "Highest duplications"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 1, 4); + widget.addProperty(METRIC_PROPERTY, "duplicated_lines"); + widget.addProperty(TITLE_PROPERTY, "Highest duplications"); widget = dashboard.addWidget("hotspot_most_violated_resources", 2, 1); - widget = dashboard.addWidget("hotspot_metric", 2, 2); - widget.addProperty("metric", "uncovered_lines"); - widget.addProperty("title", "Highest untested lines"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 2, 2); + widget.addProperty(METRIC_PROPERTY, "uncovered_lines"); + widget.addProperty(TITLE_PROPERTY, "Highest untested lines"); - widget = dashboard.addWidget("hotspot_metric", 2, 3); - widget.addProperty("metric", "function_complexity"); - widget.addProperty("title", "Highest average method complexity"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 2, 3); + widget.addProperty(METRIC_PROPERTY, "function_complexity"); + widget.addProperty(TITLE_PROPERTY, "Highest average method complexity"); - widget = dashboard.addWidget("hotspot_metric", 2, 4); - widget.addProperty("metric", "public_undocumented_api"); - widget.addProperty("title", "Most undocumented APIs"); + widget = dashboard.addWidget(HOTSPOT_METRIC, 2, 4); + widget.addProperty(METRIC_PROPERTY, "public_undocumented_api"); + widget.addProperty(TITLE_PROPERTY, "Most undocumented APIs"); return dashboard; } |