Showing 5 of 5 total issues
Method copy_fias_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def copy_fias_data
puts 'Copying data from FIAS...'
encoder = PgDataEncoder::EncodeForCopy.new(
column_types: { 0 => :uuid, 1 => :uuid, 2 => :uuid }
Method extract_names
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_names
extracted = @params.map do |name, value|
if value.is_a?(Array)
[name, value]
else
- 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 only
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def only(*names)
return @files if names.empty?
names = names.map do |name|
name = name.to_sym
- 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 open_files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def open_files(encoding)
TABLES.each do |accessor, dbf_filename|
filename = File.join(@path, dbf_filename)
next unless File.exist?(filename)
- 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 encode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def encode
@dbf.each do |record|
line = record.to_a.map { |v| v == '' ? nil : v }
@encoder.add(line)
yield if block_given?
- 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"