This commit is contained in:
Marian Steinbach 2021-11-11 20:09:20 +01:00
parent 5ad73edf7a
commit df314c0677
2 changed files with 12 additions and 10 deletions

View File

@ -42,11 +42,12 @@ class Rater(AbstractRater):
# Calculate score based on the largest value found for a URL.
# See https://github.com/netzbegruenung/green-spider/issues/11#issuecomment-600307544
# for details.
value = max(payloads_for_urls)
if value < 994000:
score = 1
elif value < 1496000:
score = .5
if len(payloads_for_urls) > 0:
value = max(payloads_for_urls)
if value < 994000:
score = 1
elif value < 1496000:
score = .5
return {
'type': self.rating_type,

View File

@ -42,11 +42,12 @@ class Rater(AbstractRater):
# Calculate score based on the largest value found for a URL.
# See https://github.com/netzbegruenung/green-spider/issues/11#issuecomment-600307544
# for details.
value = max(num_requests_for_urls)
if value <= 28:
score = 1.0
elif value <= 38:
score = 0.5
if len(num_requests_for_urls) > 0:
value = max(num_requests_for_urls)
if value <= 28:
score = 1.0
elif value <= 38:
score = 0.5
return {
'type': self.rating_type,