Method set_place
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_place(result, row)
if result.numeric_place?
result.place = result.numeric_place
if race?(row) && result.place != 1
import_warnings << "First racer #{row[:first_name]} #{row[:last_name]} should be first place racer. "
- 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 result?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result?(row)
return false unless row
return true if row[:place].present? || row[:number].present? || row[:license].present? || row[:team_name].present?
return true unless row[:first_name].blank? && row[:last_name].blank? && row[:name].blank?
- 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 assert_columns!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def assert_columns!(table)
keys = table.columns.map(&:key)
import_warnings << "No place column. Place is required." unless keys.include?(:place)
unless keys.include?(:name) || (keys.include?(:first_name) && keys.include?(:lastname)) || keys.include?(:team_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 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"
Further reading
Method result_methods
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def result_methods(row, _race)
attributes = row.to_hash.dup
custom_attributes = {}
attributes.delete_if do |key, value|
_key = key.to_s.to_sym
- 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"