Fix RBL score: return A+ when not listed on any blocklist
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:
nemunaire 2026-03-26 10:22:50 +07:00
commit 1002bcbde2

View file

@ -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)
} }