Showing 3 of 5 total issues
Method create_shards
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_shards
config.table_names.each do |table_name|
SchemaIterator.new.iterate_on(table_name) do |conn, schema_name, table_name|
Sequel::SchemaSharding.logger.warn "Creating schema #{schema_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 create_databases
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_databases
config.physical_shard_configs.each_pair do |name, config|
begin
# Need to create connection manually with specifying a database in order to create the database
connection = Sequel.postgres(:user => config['username'],
- 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 drop_databases
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def drop_databases
connection_manager.disconnect
config.physical_shard_configs.each_pair do |name, config|
# Need to create connection manually with specifying a database in order to create the database
begin
- 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"