diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-29 23:13:08 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-29 23:13:08 +0200 |
commit | d864b2120708473a363bed2f4fa50ecdf73762a1 (patch) | |
tree | c110e994f74e12202f9111fab692ed0298a5f1f7 | |
parent | 80fb6e85116635811a262052da8d740ab178ca55 (diff) | |
download | sonarqube-d864b2120708473a363bed2f4fa50ecdf73762a1.tar.gz sonarqube-d864b2120708473a363bed2f4fa50ecdf73762a1.zip |
Fix some quality flaws
3 files changed, 15 insertions, 13 deletions
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java index af295bdd139..78d561c8fff 100644 --- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java +++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java @@ -33,21 +33,21 @@ import java.util.List; @Property(key = DbCleanerConstants.HOURS_BEFORE_KEEPING_ONLY_ONE_SNAPSHOT_BY_DAY, defaultValue = "24", name = "Number of hours before starting to keep only one snapshot per day", description = "After this number of hours, if there are several snapshots during the same day, " - + "the DbCleaner keeps the most recent one and fully delete the other ones.", + + "the DbCleaner keeps the most recent one and fully deletes the other ones.", global = true, project = true, type = PropertyType.INTEGER), @Property(key = DbCleanerConstants.WEEKS_BEFORE_KEEPING_ONLY_ONE_SNAPSHOT_BY_WEEK, defaultValue = "4", name = "Number of weeks before starting to keep only one snapshot per week", description = "After this number of weeks, if there are several snapshots during the same week, " - + "the DbCleaner keeps the most recent one and fully delete the other ones.", + + "the DbCleaner keeps the most recent one and fully deletes the other ones.", global = true, project = true, type = PropertyType.INTEGER), @Property(key = DbCleanerConstants.WEEKS_BEFORE_KEEPING_ONLY_ONE_SNAPSHOT_BY_MONTH, defaultValue = "52", name = "Number of weeks before starting to keep only one snapshot per month", description = "After this number of weeks, if there are several snapshots during the same month, " - + "the DbCleaner keeps the most recent one and fully delete the other ones.", + + "the DbCleaner keeps the most recent one and fully deletes the other ones.", global = true, project = true, type = PropertyType.INTEGER), @@ -61,6 +61,7 @@ import java.util.List; key = DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY, defaultValue = "true", name = "Clean history data of directories/packages", + description = "If set to true, no history is kept at directory/package level. Setting this to false can cause database bloat.", global = true, project = true, module = false, @@ -68,8 +69,8 @@ import java.util.List; @Property( key = DbCleanerConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES, defaultValue = "30", - name = "Number of days before deleting closed Issues", - description = "Issues are deleted after this number of days in the status CLOSED.", + name = "Number of days before deleting closed issues", + description = "Issues that have been closed for more than this number of days will be deleted.", global = true, project = true, type = PropertyType.INTEGER) diff --git a/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java index 3498c241c61..d5caa5bde19 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectConfigurator.java @@ -70,18 +70,19 @@ public class ProjectConfigurator implements BatchComponent { checkCurrentAnalyisIsTheLatestOne(project, analysisDate); project - .setConfiguration(new PropertiesConfiguration()) // will be populated by ProjectSettings - .setAnalysisDate(analysisDate) - .setAnalysisVersion(loadAnalysisVersion()) - .setAnalysisType(loadAnalysisType()); + .setConfiguration(new PropertiesConfiguration()) // will be populated by ProjectSettings + .setAnalysisDate(analysisDate) + .setAnalysisVersion(loadAnalysisVersion()) + .setAnalysisType(loadAnalysisType()); return this; } - private void checkCurrentAnalyisIsTheLatestOne(Project project, Date analysisDate){ + private void checkCurrentAnalyisIsTheLatestOne(Project project, Date analysisDate) { if (!isLatestAnalysis(project.getKey(), analysisDate)) { throw new IllegalArgumentException( - "The value '"+ settings.getString(CoreProperties.PROJECT_DATE_PROPERTY) +"' of the sonar.projectDate property can't be older than the date of last known quality snapshot " + - "on this project. This property must be used to replay the past in a chronological order."); + "The value '" + settings.getString(CoreProperties.PROJECT_DATE_PROPERTY) + "' of the sonar.projectDate property " + + "can't be older than the date of last known quality snapshot " + + "on this project. This property must only be used to rebuild the past in a chronological order."); } } diff --git a/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java index 7daa14f9c90..ce13c0b7177 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java @@ -155,7 +155,7 @@ public class ProjectConfiguratorTest extends AbstractDbUnitTestCase { fail(); } catch (Exception e) { assertThat(e).isInstanceOf(IllegalArgumentException.class).hasMessage("The value '2005-12-25' of the sonar.projectDate property can't be older than the date " + - "of last known quality snapshot on this project. This property must be used to replay the past in a chronological order."); + "of last known quality snapshot on this project. This property must only be used to rebuild the past in a chronological order."); } } |