From ff2891f84bd97248d61ad0678a8d2a5115b8ba3d Mon Sep 17 00:00:00 2001 From: devtty1er Date: Wed, 18 Oct 2023 18:02:42 +0000 Subject: [PATCH] Revert scoring algorithm Fixes #1940 --- mobsf/StaticAnalyzer/views/common/appsec.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mobsf/StaticAnalyzer/views/common/appsec.py b/mobsf/StaticAnalyzer/views/common/appsec.py index 7d167275b8..b8860950c9 100644 --- a/mobsf/StaticAnalyzer/views/common/appsec.py +++ b/mobsf/StaticAnalyzer/views/common/appsec.py @@ -178,13 +178,11 @@ def common_fields(findings, data): high = len(findings.get('high')) warn = len(findings.get('warning')) sec = len(findings.get('secure')) - total = high + warn + sec - score = 0 - if total > 0: - score = int(100 - ( - ((high * 1) + (warn * .5) - (sec * .2)) / total) * 100) + score = 100 - (high * 15) - (warn * 10) + (sec * 5) if score > 100: score = 100 + elif score < 0: + score = 10 findings['security_score'] = score findings['app_name'] = data.get('app_name', '') findings['file_name'] = data.get('file_name', '')