From a0b9f5612d661375fc6fa8e8c97a9b0a5dcd7ff7 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 4 Dec 2012 10:34:34 +0100 Subject: Decrease two methods complexity --- .../src/main/java/org/sonar/batch/bootstrap/DurationLabel.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sonar-batch') 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); -- cgit v1.2.3