Autofix Rubocop Style/RedundantBegin (#23703)
This commit is contained in:
parent
167709f6b0
commit
2177daeae9
69 changed files with 458 additions and 695 deletions
|
@ -99,21 +99,17 @@ class Trends::Statuses < Trends::Base
|
|||
expected = 1.0
|
||||
observed = (status.reblogs_count + status.favourites_count).to_f
|
||||
|
||||
score = begin
|
||||
if expected > observed || observed < options[:threshold]
|
||||
0
|
||||
else
|
||||
((observed - expected)**2) / expected
|
||||
end
|
||||
end
|
||||
score = if expected > observed || observed < options[:threshold]
|
||||
0
|
||||
else
|
||||
((observed - expected)**2) / expected
|
||||
end
|
||||
|
||||
decaying_score = begin
|
||||
if score.zero? || !eligible?(status)
|
||||
0
|
||||
else
|
||||
score * (0.5**((at_time.to_f - status.created_at.to_f) / options[:score_halflife].to_f))
|
||||
end
|
||||
end
|
||||
decaying_score = if score.zero? || !eligible?(status)
|
||||
0
|
||||
else
|
||||
score * (0.5**((at_time.to_f - status.created_at.to_f) / options[:score_halflife].to_f))
|
||||
end
|
||||
|
||||
[decaying_score, status]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue