Showing 14 of 16 total issues
Method timeline
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def timeline(record = nil, options = {})
rid =
if record
if record.respond_to?(:rid)
record.rid
- 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 timeline
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def timeline(record = nil, options = {})
rid =
if record
if record.respond_to?(:rid)
record.rid
Method change_table
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def change_table(table_name, **options, &block)
transaction do
# Add an empty proc to support calling change_table without a block.
#
block ||= proc {}
- 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_upgrade_from_postgres_v90
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def chrono_upgrade_from_postgres_v90(table_name)
# roses are red
# violets are blue
# and this is the most boring piece of code ever
history_table = "#{HISTORY_SCHEMA}.#{table_name}"
Method chrono_create_UPDATE_trigger
has 8 arguments (exceeds 4 allowed). Consider refactoring. 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
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
def chrono_create_INSERT_trigger(table, pk, current, history, fields, values)
Method changes_against
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def changes_against(ref)
self.class.attribute_names_for_history_changes.inject({}) do |changes, attr|
old = ref.public_send(attr)
new = public_send(attr)
- 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 time_query_sql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def time_query_sql(match, time, range, options)
case match
when :at
build_time_query_at(time, range)
- 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_tables_needing_upgrade
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def chrono_tables_needing_upgrade
tables = {}
on_temporal_schema { self.tables }.each do |table_name|
next unless is_chrono?(table_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 chrono_upgrade_structure!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def chrono_upgrade_structure!
transaction do
chrono_tables_needing_upgrade.each do |table_name, desc|
if desc[:version].blank?
logger.info "ChronoModel: Upgrading legacy PG 9.0 table #{table_name} to #{VERSION}"
- 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 pred
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pred(options = {})
if self.class.timeline_associations.empty?
history.reverse_order.second
else
return nil unless (ts = pred_timestamp(options))
- 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 on_schema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_schema(schema, recurse: :follow)
old_path = schema_search_path
count_recursions do
if (recurse == :follow) || (Thread.current['recursions'] == 1)
- 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_UPDATE_trigger
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. 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"