BenMusch/nu-tab

View on GitHub
app/models/team.rb

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 4 total issues

Assignment Branch Condition size for <=> is too high. [24.74/15]
Wontfix

def <=>(other)
if had_rounds? && other.had_rounds?
return other.stats.wins - stats.wins unless stats.wins == other.stats.wins
super(other)
elsif !had_rounds? && !other.had_rounds?
Severity: Minor
Found in app/models/team.rb by rubocop

Perceived complexity for <=> is too high. [8/7]
Wontfix

def <=>(other)
if had_rounds? && other.had_rounds?
return other.stats.wins - stats.wins unless stats.wins == other.stats.wins
super(other)
elsif !had_rounds? && !other.had_rounds?
Severity: Minor
Found in app/models/team.rb by rubocop

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

def <=>(other)
if had_rounds? && other.had_rounds?
return other.stats.wins - stats.wins unless stats.wins == other.stats.wins
super(other)
elsif !had_rounds? && !other.had_rounds?
Severity: Minor
Found in app/models/team.rb - About 1 hr to fix

Use %i or %I for an array of symbols.
Open

enum seed: [:full_seed, :half_seed, :free_seed, :unseeded]
Severity: Minor
Found in app/models/team.rb by rubocop
Category
Status