Fix RBL score: return A+ when not listed on any blocklist

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.
This commit is contained in:
nemunaire 2026-03-26 10:22:50 +07:00
commit dfa38e8a26

View file

@ -305,11 +305,11 @@ func (r *DNSListChecker) CalculateScore(results *DNSListResults) (int, string) {
return 100, ""
}
scoringListCount := len(r.Lists) - len(r.informationalSet)
if scoringListCount <= 0 {
if results.ListedCount <= 0 {
return 100, "A+"
}
scoringListCount := len(r.Lists) - len(r.informationalSet)
percentage := 100 - results.RelevantListedCount*100/scoringListCount
return percentage, ScoreToGrade(percentage)
}