app/controllers/athletes_controller.rb
Complex method AthletesController#index (32.3) Open
Open
def index
query = params[:q].to_s.gsub(/[^[:alnum:][:blank:]]/, '').strip
criteria = Athlete.order(:event_id).limit(100)
@athletes =
if query.length < 3
- 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
Complex method AthletesController#show (27.8) Open
Open
def show
@athlete = Athlete.find(params[:id])
results = @athlete.results.published
@total_results = results.size
if @total_results.positive?
- 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