app/models/participant.rb
Complex method Participant#update_elo_for (24.2) Open
Open
def update_elo_for(match_result, opponent)
opponent_rating = opponent.rating
k_factor = event.maximum_elo_change
expectation = 1.0 / (1.0 + (10.0**((opponent_rating - rating) / 400.0)))
update(rating: rating + k_factor * (match_result - expectation))
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool