Method basic_bin_stats
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def basic_bin_stats bin
# cumulative length is a float so we can divide it
# accurately later to get the mean length
cumulative_length = 0.0
- 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 basic_bin_stats
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def basic_bin_stats bin
# cumulative length is a float so we can divide it
# accurately later to get the mean length
cumulative_length = 0.0
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize file
@file = File.expand_path file
unless File.exist? @file
raise TransrateIOError.new "Assembly file doesn't exist: #{@file}"
end
Method classify_contigs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def classify_contigs cutoff
# create hash of file handles for each output
base = File.basename @file
files = {}
%w(good bad).each do |type|
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize file
@file = File.expand_path file
unless File.exist? @file
raise TransrateIOError.new "Assembly file doesn't exist: #{@file}"
end
- 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 classify_contigs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def classify_contigs cutoff
# create hash of file handles for each output
base = File.basename @file
files = {}
%w(good bad).each do |type|
- 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"