Fix RBL score: return A+ when not listed on any blocklist
Some checks are pending
continuous-integration/drone/push Build is running
Some checks are pending
continuous-integration/drone/push Build is running
Move the ListedCount check before scoringListCount calculation so we return early with a perfect score when the IP/domain is not listed, regardless of how many informational-only lists exist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dee848d887
commit
1002bcbde2
1 changed files with 2 additions and 2 deletions
|
|
@ -305,11 +305,11 @@ func (r *DNSListChecker) CalculateScore(results *DNSListResults) (int, string) {
|
||||||
return 100, ""
|
return 100, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
scoringListCount := len(r.Lists) - len(r.informationalSet)
|
if results.ListedCount <= 0 {
|
||||||
if scoringListCount <= 0 {
|
|
||||||
return 100, "A+"
|
return 100, "A+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoringListCount := len(r.Lists) - len(r.informationalSet)
|
||||||
percentage := 100 - results.RelevantListedCount*100/scoringListCount
|
percentage := 100 - results.RelevantListedCount*100/scoringListCount
|
||||||
return percentage, ScoreToGrade(percentage)
|
return percentage, ScoreToGrade(percentage)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue