From 7b9499e5c765523a97b6cf5d4cc157f08d449e78 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 22 Mar 2016 17:54:55 +0100 Subject: [PATCH] Fix quality flaws --- .../org/sonar/server/computation/issue/IssueLifecycle.java | 4 ++-- .../qualitymodel/QualityModelMeasuresVisitor.java | 6 +++--- .../sonar/server/computation/step/PersistSnapshotsStep.java | 6 +++--- .../main/java/org/sonar/server/rule/DefaultRuleFinder.java | 2 +- .../src/main/java/org/sonar/db/component/ResourceDao.java | 2 +- .../api/server/rule/RulesDefinitionAnnotationLoader.java | 2 +- .../org/sonar/api/server/rule/RulesDefinitionXmlLoader.java | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueLifecycle.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueLifecycle.java index 167755c60d9..deb747d94e4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueLifecycle.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/IssueLifecycle.java @@ -92,8 +92,8 @@ public class IssueLifecycle { updater.setPastLine(raw, base.getLine()); updater.setPastLocations(raw, base.getLocations()); updater.setPastMessage(raw, base.getMessage(), changeContext); - updater.setPastGap(raw, base.effortToFix(), changeContext); - updater.setPastEffort(raw, base.debt(), changeContext); + updater.setPastGap(raw, base.gap(), changeContext); + updater.setPastEffort(raw, base.effort(), changeContext); raw.setSelectedAt(base.selectedAt()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitymodel/QualityModelMeasuresVisitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitymodel/QualityModelMeasuresVisitor.java index 6860cc81b47..747a2a108d2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitymodel/QualityModelMeasuresVisitor.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitymodel/QualityModelMeasuresVisitor.java @@ -311,9 +311,9 @@ public class QualityModelMeasuresVisitor extends PathAwareVisitorAdapter params) { + private static org.sonar.api.rules.Rule toRule(RuleDto rule, List params) { String severity = rule.getSeverityString(); String description = rule.getDescription(); RuleDto.Format descriptionFormat = rule.getDescriptionFormat(); diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java index c68302f8a4a..4624d3cf94d 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java @@ -64,7 +64,7 @@ public class ResourceDao extends AbstractDao { return null; } - private List getResources(ResourceQuery query, SqlSession session) { + private static List getResources(ResourceQuery query, SqlSession session) { return session.getMapper(ResourceMapper.class).selectResources(query); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionAnnotationLoader.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionAnnotationLoader.java index 13058659411..9be365feb29 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionAnnotationLoader.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionAnnotationLoader.java @@ -74,7 +74,7 @@ public class RulesDefinitionAnnotationLoader { } } - private RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class clazz, org.sonar.check.Rule ruleAnnotation) { + private static RulesDefinition.NewRule loadRule(RulesDefinition.NewExtendedRepository repo, Class clazz, org.sonar.check.Rule ruleAnnotation) { String ruleKey = StringUtils.defaultIfEmpty(ruleAnnotation.key(), clazz.getCanonicalName()); String ruleName = StringUtils.defaultIfEmpty(ruleAnnotation.name(), null); String description = StringUtils.defaultIfEmpty(ruleAnnotation.description(), null); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java index 996a044d19b..6ee19d515bd 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java @@ -232,7 +232,7 @@ public class RulesDefinitionXmlLoader { } } - private void processRule(RulesDefinition.NewRepository repo, SMInputCursor ruleC) throws XMLStreamException { + private static void processRule(RulesDefinition.NewRepository repo, SMInputCursor ruleC) throws XMLStreamException { String key = null; String name = null; String description = null; -- 2.39.5