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

View file

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