From 144b731489f00e0eb2406036ddcf3fab3a5126aa Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 7 Jun 2022 16:08:57 -0500 Subject: SONAR-11401 Calculate hotspot measures --- .../java/org/sonar/server/security/SecurityReviewRating.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/sonar-server-common') diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityReviewRating.java b/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityReviewRating.java index 463c0b17901..35ce1e1b0a9 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityReviewRating.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityReviewRating.java @@ -40,17 +40,17 @@ public class SecurityReviewRating { if (total == 0) { return Optional.empty(); } - return Optional.of(hotspotsReviewed * 100.0 / total); + return Optional.of(hotspotsReviewed * 100.0D / total); } public static Rating computeRating(@Nullable Double percent) { - if (percent == null || percent >= 80.0) { + if (percent == null || percent >= 80.0D) { return A; - } else if (percent >= 70.0) { + } else if (percent >= 70.0D) { return B; - } else if (percent >= 50.0) { + } else if (percent >= 50.0D) { return C; - } else if (percent >= 30.0) { + } else if (percent >= 30.0D) { return D; } return E; -- cgit v1.2.3