lib/chrono_model/adapter/ddl.rb
Method chrono_create_UPDATE_trigger
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def chrono_create_UPDATE_trigger(table, pk, current, history, fields, values, options, columns)
Method chrono_public_view_ddl
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def chrono_public_view_ddl(table, options = nil)
pk = primary_key(table)
current = "#{TEMPORAL_SCHEMA}.#{table}"
history = "#{HISTORY_SCHEMA}.#{table}"
- 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 chrono_create_INSERT_trigger
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def chrono_create_INSERT_trigger(table, pk, current, history, fields, values)
Method chrono_create_UPDATE_trigger
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def chrono_create_UPDATE_trigger(table, pk, current, history, fields, values, options, columns)
# Columns to be journaled. By default everything except updated_at (GH #7)
#
journal =
if options[:journal]
- 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"