Showing 333 of 1,278 total issues
Method destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@event = Event.find(params[:id])
if @event.destroy
expire_cache
respond_to do |format|
- 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 age_category
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def age_category
if female?
if junior?
"girl"
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"
Further reading
Method th
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def th(attribute = nil, *options)
_attribute = nil
_attribute = attribute.to_s if attribute
locals = { attribute: _attribute }
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.render(column, row)
result = row.source
text = row[column.key]
return text unless result.person_id
- 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 <=>
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def <=>(other)
return -1 if other.nil?
return super unless other.is_a?(Category)
return 0 if self[:id] && self[:id] == other[:id]
- 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 []
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.[](name)
return nil unless name
load_aliases if @@all_aliases.nil?
if name.is_a?(Symbol)
- 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 resolve_duplicates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve_duplicates
@duplicates = Duplicate.all
@duplicates.each do |duplicate|
id = params[duplicate.to_param]
if id == "new"
- 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 ages=
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ages=(value)
case value
when Range
self.ages_begin = value.begin
self.ages_end = value.end
- 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_new_event
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def assign_new_event
if params[:event].nil?
@event = SingleDayEvent.new
return true
end
- 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 find_all_for_export
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.find_all_for_export(date = Time.zone.today, include_people = "members_only")
association_number_issuer_id = NumberIssuer.find_by(name: RacingAssociation.current.short_name).id
case include_people
when "members_only"
where_clause = "WHERE (people.member_to >= '#{date}')"
- 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 fill_in_editor_field
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fill_in_editor_field(with:, currently_with: nil, fill_options: {}, **find_options)
retries = 0
3.times do
assert_selector "form.editor_field"
within "form.editor_field" do
- 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 render_page
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def render_page(path = nil)
unless path
path = controller_path
path = "#{path}/#{action_name}" unless action_name == "index"
end
- 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
Avoid too many return
statements within this method. Open
return "" if name.include?("N/A")
Avoid too many return
statements within this method. Open
return true if RacingAssociation.current.rental_numbers.include?(numeric_value)
Avoid too many return
statements within this method. Open
return id <=> other.id unless new_record? || other.new_record?
Avoid too many return
statements within this method. Open
return event if diff < 5 && similar_dates?(event)
Avoid too many return
statements within this method. Open
return numeric_place <=> other.numeric_place
Avoid too many return
statements within this method. Open
return id <=> other.id
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 nil if candidate_categories.empty?