Showing 333 of 1,278 total issues
Avoid too many return
statements within this method. Open
return render(:new_login) if @person.errors.any?
Avoid too many return
statements within this method. Open
return masters_categories.first if masters_categories.one?
Avoid too many return
statements within this method. Open
return ability_category if ability_category.include?(self)
Avoid too many return
statements within this method. Open
return candidate_categories.first if one_match?(candidate_categories)
Avoid too many return
statements within this method. Open
return highest_ability_category if highest_ability_category.include?(self)
Avoid too many return
statements within this method. Open
return render(:show)
Avoid too many return
statements within this method. Open
return candidate_categories.first if one_match?(candidate_categories)
Avoid too many return
statements within this method. Open
return highest_ability_category if highest_ability_category.include?(self)
Avoid too many return
statements within this method. Open
return highest_age_category if highest_age_category&.include?(self)
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return highest_senior_category if highest_senior_category
Avoid too many return
statements within this method. Open
return nil if candidate_categories.empty?
Avoid too many return
statements within this method. Open
return render(:show)
Avoid too many return
statements within this method. Open
return candidate_categories.first if candidate_categories.one? && equipment?
Avoid too many return
statements within this method. Open
return equipment_categories.first if equipment_categories.one?
Avoid too many return
statements within this method. Open
return nil if candidate_categories.empty?
Avoid too many return
statements within this method. Open
return redirect_to("http://#{RacingAssociation.current.static_host}/bar/#{@year}")
Method points
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def points(result, rules)
if rules[:use_source_result_points]
result.points
elsif result.upgrade
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method location=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def location=(value)
if value.present?
self.city, self.state = value.split(",")
self.city = city.strip if city
self.state = state.strip if state
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method same_time?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.same_time?(row)
return false unless row.previous
return true if row[:time].blank?
if row[:time].present?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"