Method build_index
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def build_index file, threads
@index_name = File.basename(file, File.extname(file))
n = 4
err = ""
loop 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"
Further reading
Method map_reads
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def map_reads(file, left, right, outputname: nil, threads: 8)
raise SnapError.new("Index not built") if !@index_built
lbase = File.basename(left.split(",").first)
rbase = File.basename(right.split(",").first)
Method build_index
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_index file, threads
@index_name = File.basename(file, File.extname(file))
n = 4
err = ""
loop do
Method map_reads
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def map_reads(file, left, right, outputname: nil, threads: 8)
raise SnapError.new("Index not built") if !@index_built
lbase = File.basename(left.split(",").first)
rbase = File.basename(right.split(",").first)
- 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 load_readcount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_readcount reads
@read_count = 0
if File.exist?("#{@read_count_file}")
@read_count = File.open("#{@read_count_file}").readlines.join.to_i
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"