BenMusch/nu-tab

View on GitHub
app/models/concerns/rankable.rb

Summary

Maintainability
A
25 mins
Test Coverage

Showing 3 of 3 total issues

Method <=> has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def <=>(other)
RANKING_PRIORITY.each do |attr|
difference = other.stats.send(attr) - stats.send(attr)
next if difference.zero?
return attr.include?('ranks') ? -1 * difference : difference
Severity: Minor
Found in app/models/concerns/rankable.rb - About 25 mins to fix

Add an empty line after magic comments.
Open

module Rankable
Severity: Minor
Found in app/models/concerns/rankable.rb by rubocop

%w-literals should be delimited by [ and ].
Open

RANKING_PRIORITY = %w(speaks
ranks
single_adjusted_speaks
single_adjusted_ranks
double_adjusted_speaks
Severity: Minor
Found in app/models/concerns/rankable.rb by rubocop
Category
Status