diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2012-12-04 10:34:34 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2012-12-04 10:34:34 +0100 |
commit | a0b9f5612d661375fc6fa8e8c97a9b0a5dcd7ff7 (patch) | |
tree | 8896c1265c178078e9f1a5287d9fa78b01f3c2a9 /sonar-batch | |
parent | fe5e5d0c6c9e0629469df039d0a1b65c505a2f7d (diff) | |
download | sonarqube-a0b9f5612d661375fc6fa8e8c97a9b0a5dcd7ff7.tar.gz sonarqube-a0b9f5612d661375fc6fa8e8c97a9b0a5dcd7ff7.zip |
Decrease two methods complexity
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/bootstrap/DurationLabel.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DurationLabel.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DurationLabel.java index bc3263fa472..132d1c12318 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DurationLabel.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/DurationLabel.java @@ -44,7 +44,7 @@ public class DurationLabel { double days = hours / 24; double years = days / 365; - final String time; + String time = MessageFormat.format(this.years, Math.floor(years)); if (seconds < 45) { time = this.seconds; } else if (seconds < 90) { @@ -65,8 +65,6 @@ public class DurationLabel { time = MessageFormat.format(this.months, Math.floor(days / 30)); } else if (years < 2) { time = this.year; - } else { - time = MessageFormat.format(this.years, Math.floor(years)); } return join(prefixAgo, time, suffixAgo); |