Method table
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def table(table, stream)
columns = @connection.columns(table)
begin
self.table_name = 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 _indexes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _indexes(table, stream)
if (indexes = @connection.indexes(table)).any?
add_index_statements = indexes.filter_map do |index|
case index.type
when nil
- 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 table
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def table(table, stream)
columns = @connection.columns(table)
begin
self.table_name = table
Method synonyms
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def synonyms(stream)
syns = @connection.synonyms
syns.each do |syn|
next if ignored? syn.name
table_name = syn.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 tables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tables(stream)
# do not include materialized views in schema dump - they should be created separately after schema creation
sorted_tables = (@connection.tables - @connection.materialized_views).sort
sorted_tables.each do |tbl|
# add table prefix or suffix for schema_migrations
- 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"