Showing 7 of 7 total issues
Method parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def parse
return @result if @result
values = []
skip(OPEN_PAREN)
if skip(CLOSE_PAREN)
- 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 composite_type_to_string
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.composite_type_to_string(object, adapter)
quoted_values = object.class.columns.collect do |column|
value = object.send(column.name)
if String === value
if value == "NULL"
- 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 composite_type_to_string
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.composite_type_to_string(object, adapter)
quoted_values = object.class.columns.collect do |column|
value = object.send(column.name)
if String === value
if value == "NULL"
- 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 type_cast_for_database
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def type_cast_for_database(object)
return object if object.is_a?(String) # already quoted by AREL visitor
return nil if object == nil
quoted_values = object.class.columns.collect do |column|
value = object.send(column.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 type_cast_attribute_for_write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def type_cast_attribute_for_write(column, value)
if column && !value.nil? && (klass = column.composite_type_class)
# Cast Hash and Array to composite type klass
if value.is_a?(klass)
value
- 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 type_cast_composite_type_field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.type_cast_composite_type_field(klass, i, value)
klass.initialize_column_definition
column = klass.columns[i]
raise "Invalid column index: #{i}" unless column
- 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 type_cast_field_from_user
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def type_cast_field_from_user(column, value)
klass = column.composite_type_class
if klass
case value
when Hash, Array
- 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"