vol1ura/Sat_9am_5km

View on GitHub
app/models/athlete.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Complex method Athlete#award_by_five_plus_badge? (40.5)
Open

  def award_by_five_plus_badge?
    initial_date = Date.current.saturday? ? Date.current : Date.tomorrow.prev_week(:saturday)
    Activity
      .where(id: results.select(:activity_id))
      .or(Activity.where(id: Volunteer.where(athlete: self).select(:activity_id)))
Severity: Minor
Found in app/models/athlete.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

Complex method Athlete::duplicates (25.4)
Open

  def self.duplicates
    sql = <<~SQL.squish
      SELECT id, parkrun_code, fiveverst_code, l_name FROM (
        SELECT id, parkrun_code, fiveverst_code, l_name, COUNT(id) OVER (PARTITION BY l_name) AS cnt FROM (
          SELECT *, array(SELECT unnest(string_to_array(LOWER(name), ' ')) ORDER BY 1) AS l_name FROM athletes
Severity: Minor
Found in app/models/athlete.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