Skip to content

Commit

Permalink
Revert scoring algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
devtty1er committed Oct 18, 2023
1 parent 98296f5 commit ff2891f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mobsf/StaticAnalyzer/views/common/appsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit ff2891f

Please sign in to comment.