aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2022-06-07 16:08:57 -0500
committersonartech <sonartech@sonarsource.com>2022-06-10 08:15:07 +0000
commit144b731489f00e0eb2406036ddcf3fab3a5126aa (patch)
treeac78333357b6307ebc82a3104204e1737ced3858 /server/sonar-server-common
parent928f60ac3377552bce626154e3b23139fafd22b6 (diff)
downloadsonarqube-144b731489f00e0eb2406036ddcf3fab3a5126aa.tar.gz
sonarqube-144b731489f00e0eb2406036ddcf3fab3a5126aa.zip
SONAR-11401 Calculate hotspot measures
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/security/SecurityReviewRating.java10
1 files changed, 5 insertions, 5 deletions
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;