Showing 10 of 10 total issues
Method get_updated_records
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_updated_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude = args[:exclude_fields] || []
- 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 bulk_insert
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def bulk_insert(columns, values, args = {})
# Limit inserts
max_records_per_insert = args[:max_records_per_insert] || 100
table = args[:into] || table_name
columns = columns.clone
- 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 get_updated_records
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_updated_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude = args[:exclude_fields] || []
Method get_deleted_records
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_deleted_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude_virtual = args[:exclude_virtual].nil? ? false : args[:exclude_virtual]
- 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 bulk_insert
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def bulk_insert(columns, values, args = {})
# Limit inserts
max_records_per_insert = args[:max_records_per_insert] || 100
table = args[:into] || table_name
columns = columns.clone
Method get_new_records
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_new_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude = args[:exclude_fields] || []
- 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 get_deleted_records
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_deleted_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude_virtual = args[:exclude_virtual].nil? ? false : args[:exclude_virtual]
Method get_new_records
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_new_records(args = {})
model = args[:for] || self
compare_table = args[:compare_with]
keys = args[:on] || 'id'
exclude = args[:exclude_fields] || []
Method bulk_update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def bulk_update(columns, values, args = {})
temp_table = "#{table_name}_temp_table_#{$$}"
key = args[:key] || args[:keys] || 'id'
condition = args[:condition]
exclude_fields = args[:exclude_fields]
- 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 insert_str
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def insert_str(element)
if element.class == Fixnum || element.class == Float
element
elsif element.class == NilClass
'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"