Method create_digestion_file
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def create_digestion_file(fasta_file, opts={})
opts = DEFAULT_PEPTIDE_CENTRIC_DB.merge(opts)
(missed_cleavages, enzyme, cleave_initiator_methionine, expand_aa) = opts.values_at(:missed_cleavages, :enzyme, :cleave_initiator_methionine, :expand_aa)
start_time = Time.now
- 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 hash_like_from_digestion_file
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def hash_like_from_digestion_file(digestion_file, min_length, data_type=:hash)
case data_type
when :trie
trie = get_a_trie
::IO.foreach(digestion_file) do |line|
- 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 hash_like_from_digestion_file
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def hash_like_from_digestion_file(digestion_file, min_length, data_type=:hash)
case data_type
when :trie
trie = get_a_trie
::IO.foreach(digestion_file) do |line|
Method create_digestion_file
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_digestion_file(fasta_file, opts={})
opts = DEFAULT_PEPTIDE_CENTRIC_DB.merge(opts)
(missed_cleavages, enzyme, cleave_initiator_methionine, expand_aa) = opts.values_at(:missed_cleavages, :enzyme, :cleave_initiator_methionine, :expand_aa)
start_time = Time.now
Method cmdline
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.cmdline(argv)
opt = DEFAULT_PEPTIDE_CENTRIC_DB.dup
opts = OptionParser.new do |op|
op.banner = "usage: #{File.basename($0)} <file>.fasta ..."
Method db_from_fasta_digestion_file
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def db_from_fasta_digestion_file(digestion_file, opts={})
opts = DEFAULT_PEPTIDE_CENTRIC_DB.merge(opts)
start_time = Time.now
puts "Organizing raw digestion #{digestion_file} ..." if $VERBOSE
Method db_from_fasta_digestion_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def db_from_fasta_digestion_file(digestion_file, opts={})
opts = DEFAULT_PEPTIDE_CENTRIC_DB.merge(opts)
start_time = Time.now
puts "Organizing raw digestion #{digestion_file} ..." if $VERBOSE
- 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"