Showing 331 of 1,265 total issues
Avoid too many return
statements within this method. Open
return render(:new_login)
Avoid too many return
statements within this method. Open
return redirect_to("http://#{RacingAssociation.current.static_host}/bar/#{@year}")
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 highest_age_category if highest_age_category&.include?(self)
Avoid too many return
statements within this method. Open
return redirect_to("http://#{RacingAssociation.current.static_host}/bar/#{@year}/overall_by_age.html")
Avoid too many return
statements within this method. Open
return render(:show)
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 candidate_categories.first if one_match?(candidate_categories)
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 candidate_categories.first if one_match?(candidate_categories)
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 candidate_categories.first if candidate_categories.size == 1
Avoid too many return
statements within this method. Open
return source_result.points if points_for_place.nil?
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 diff if diff != 0
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 highest_ability_category if highest_ability_category.include?(self)
Method add_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_name
last_year = Time.zone.today.year - 1
if name_was.present? && results_before_this_year? && names.none? { |name| name.year == last_year }
name = names.build(name: name_was, year: last_year)
name.first_name = first_name_was if respond_to?(:first_name)
- 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 assign_member_from_imported_people
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def assign_member_from_imported_people(year)
if @update_membership
@member_from_imported_people = if year && year > Time.zone.today.year
Time.zone.local(year).beginning_of_year.to_date
else
- 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"