diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-10-15 16:48:38 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-10-15 16:48:38 +0200 |
commit | cd1de0a69ab51a45fba719fe6a665ed938c5e441 (patch) | |
tree | 984d4c9a381d478a5e3fa9c4692a0d696061e7af /plugins | |
parent | e25ed9de489856345748d0e45935219b83374818 (diff) | |
download | sonarqube-cd1de0a69ab51a45fba719fe6a665ed938c5e441.tar.gz sonarqube-cd1de0a69ab51a45fba719fe6a665ed938c5e441.zip |
Fix quality flaws
Diffstat (limited to 'plugins')
3 files changed, 12 insertions, 7 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java index e521d627380..2386030a5b9 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/DefaultResourceTypes.java @@ -31,24 +31,27 @@ import org.sonar.api.resources.ResourceTypeTree; public final class DefaultResourceTypes extends ExtensionProvider implements BatchExtension, ServerExtension { private static final String SUPPORTS_MEASURE_FILTERS = "supportsMeasureFilters"; + private static final String CONFIGURABLE = "configurable";; + private static final String UPDATABLE_KEY = "updatable_key"; @Override public ResourceTypeTree provide() { + return ResourceTypeTree.builder() .addType(ResourceType.builder(Qualifiers.PROJECT) .setProperty("deletable", true) .setProperty("supportsGlobalDashboards", true) .setProperty("modifiable_history", true) .setProperty("hasRolePolicy", true) - .setProperty("updatable_key", true) + .setProperty(UPDATABLE_KEY, true) .setProperty(SUPPORTS_MEASURE_FILTERS, true) .setProperty("comparable", true) - .setProperty("configurable", true) + .setProperty(CONFIGURABLE, true) .build()) .addType(ResourceType.builder(Qualifiers.MODULE) - .setProperty("updatable_key", true) + .setProperty(UPDATABLE_KEY, true) .setProperty(SUPPORTS_MEASURE_FILTERS, true) - .setProperty("configurable", true) + .setProperty(CONFIGURABLE, true) .build()) .addType(ResourceType.builder(Qualifiers.DIRECTORY) .setProperty(SUPPORTS_MEASURE_FILTERS, true) 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 92c3772b82f..82ea4532bf1 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 @@ -38,6 +38,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 COVERAGE = "coverage"; @Override public String getName() { @@ -57,7 +58,7 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { Widget timelineWidget = dashboard.addWidget("timeline", 1); timelineWidget.setProperty(METRIC1, "complexity"); timelineWidget.setProperty(METRIC2, "violations_density"); - timelineWidget.setProperty(METRIC3, "coverage"); + timelineWidget.setProperty(METRIC3, COVERAGE); Widget sizeTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard); sizeTimeMachineWidget.setProperty(METRIC1, "ncloc"); @@ -99,7 +100,7 @@ public final class ProjectTimeMachineDashboard extends DashboardTemplate { complexityTimeMachineWidget.setProperty(METRIC4, "file_complexity"); Widget testsTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard); - testsTimeMachineWidget.setProperty(METRIC1, "coverage"); + testsTimeMachineWidget.setProperty(METRIC1, COVERAGE); testsTimeMachineWidget.setProperty(METRIC2, "line_coverage"); testsTimeMachineWidget.setProperty(METRIC3, "branch_coverage"); testsTimeMachineWidget.setProperty(METRIC4, "test_success_density"); diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java index 2da8eead044..6df77203f72 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CheckAlertThresholds.java @@ -40,6 +40,7 @@ import java.util.Locale; public class CheckAlertThresholds implements Decorator { private static final String VARIATION_METRIC_PREFIX = "new_"; + private static final String VARIATION = "variation"; private final Snapshot snapshot; private final RulesProfile profile; @@ -139,7 +140,7 @@ public class CheckAlertThresholds implements Decorator { stringBuilder.append(metric); if (alertPeriod != null && !alert.getMetric().getKey().startsWith(VARIATION_METRIC_PREFIX)) { - String variation = i18n.message(getLocale(), "variation", "variation").toLowerCase(); + String variation = i18n.message(getLocale(), VARIATION, VARIATION).toLowerCase(); stringBuilder.append(" ").append(variation); } |