diff --git a/src/main/java/com/github/nexception/reviewassistant/ReviewAssistant.java b/src/main/java/com/github/nexception/reviewassistant/ReviewAssistant.java
index db87aa6..e2ce7e2 100644
--- a/src/main/java/com/github/nexception/reviewassistant/ReviewAssistant.java
+++ b/src/main/java/com/github/nexception/reviewassistant/ReviewAssistant.java
@@ -120,6 +120,8 @@ public static Calculation calculate(PatchSetCreatedEvent event) {
private static int calculateReviewTime(PatchSetCreatedEvent event) {
int lines = event.patchSet.sizeInsertions + Math.abs(event.patchSet.sizeDeletions);
int minutes = (int) Math.ceil(lines / 5);
+ minutes = (int) Math.ceil(minutes / 5.0);
+ minutes = minutes * 5;
if(minutes < 5) {
minutes = 5;
}
@@ -133,7 +135,7 @@ private static int calculateReviewTime(PatchSetCreatedEvent event) {
* @return the recommended amount of review sessions
*/
private static int calculateReviewSessions(int minutes) {
- int sessions = Math.round(minutes / 60);
+ int sessions = (int) Math.round(minutes / 60.0);
if (sessions < 1) {
sessions = 1;
}
diff --git a/src/main/java/com/github/nexception/reviewassistant/rest/GetAdvice.java b/src/main/java/com/github/nexception/reviewassistant/rest/GetAdvice.java
index b2dcf85..9cae2d6 100644
--- a/src/main/java/com/github/nexception/reviewassistant/rest/GetAdvice.java
+++ b/src/main/java/com/github/nexception/reviewassistant/rest/GetAdvice.java
@@ -42,7 +42,7 @@ public Object apply(RevisionResource resource) throws AuthException, BadRequestE
advice += calculation.minutes + " minutes";
}
advice += " reviewing this change.";
- if (calculation.sessions > 1) {
+ if (calculation.hours >= 1) {
advice += "This should be split up in " + calculation.sessions +
" to " + (calculation.sessions + 1) + " sessions.
";
}