BenMusch/nu-tab

View on GitHub

Showing 5 of 137 total issues

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

def validate_standard_result
if all_stats_submitted?
errors.add(:base, 'Ranks are invalid') unless valid_ranks?
errors.add(:base, 'Speaks are invalid') unless valid_speaks?
errors.add(:base, 'Speaks/Ranks are out of order') unless valid_speaks_ranks_order?
Severity: Minor
Found in app/models/round.rb - About 1 hr to fix

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

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

def self.policy_for(debater, round)
if round.bye? || round.all_win?
AverageStatsPolicy.new debater, round
elsif round.forfeit? || round.all_drop?
klass = round.winner?(debater.team) ? AverageStatsPolicy : self.forfeit_policy
Severity: Minor
Found in app/policies/stats/round.rb - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

render() {
return(
<div className="debater_form">
<form id="debater" onSubmit={this.handleSubmit}>
<FormGroup controlId="name">
Severity: Minor
Found in client/app/components/debaters/DebaterForm.js - About 1 hr to fix

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
Severity
Category
Status
Source
Language