Showing 7 of 7 total issues
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(csv_io, input_name, skip_original, alt_headers, stats)
Method process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process(csv, data_collector)
counter = 0
loop do
yield @stats.stats if log_progress(counter) && block_given?
rl = read_line(csv, data_collector)
- 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 read_line
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_line(csv, data_collector)
row = csv.readline
return false if row.nil?
row = process_headers(row) if @original_fields.nil?
data_collector.process_row(row)
- 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 traverse_jobs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def traverse_jobs(data)
until data.empty? && @jobs.compact.empty?
process_results(data)
cmd = yield(@stats.stats) if block_given?
break if cmd == "STOP"
- 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 iogen
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def iogen(arg, mode)
if arg.nil? || arg == "-"
mode == INPUT_MODE ? stdin : STDOUT
else
fd_i = IO.sysopen(arg, mode)
- 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 opts_struct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def opts_struct(opts)
resolver_url = "http://resolver.globalnames.org/name_resolvers.json"
threads = opts[:threads].to_i
opts[:threads] = threads.between?(1, 10) ? threads : 2
with_classification = opts[:with_classification] ? true : false
- 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 process_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_results(data)
indices = []
@jobs.each_with_index do |job, i|
next if job.nil? || !job.complete?
with_log do
- 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"