hpi-swt2/sport-portal

View on GitHub
app/models/participant.rb

Summary

Maintainability
A
0 mins
Test Coverage

Complex method Participant#update_elo_for (24.2)
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))
Severity: Minor
Found in app/models/participant.rb by flog

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

There are no issues that match your filters.

Category
Status