Showing 74 of 132 total issues
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(lst = @hits)
if type.to_s != 'nucleotide'
@validation_report = ValidationReport.new('', :unapplicable)
return @validation_report
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 check_multiple_coverage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_multiple_coverage(hit_alignment, query_alignment, hsp, coverage,
ranges_prediction)
# for each hsp of the curent hit
# iterate through the alignment and count the matching residues
[*(0..hit_alignment.length - 1)].each do |i|
- 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 calculate_run_time
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def calculate_run_time(json_data)
run_time = Hash.new(Pair1.new(0, 0))
json_data.map do |row|
row[:validations].each do |short_header, v|
next if v[:run_time].nil? || v[:run_time].zero?
- 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
Function plot_bars
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.plot_bars = function (alldata, target, title, footer, xTitle, yTitle, bar) {
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, pvalue, averages,
threshold = 0.05, expected = :yes)
Method iterate_xml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def iterate_xml(file, db_type)
n = Bio::BlastXMLParser::XmlIterator.new(opt[:blast_xml_file]).to_enum
n.each do |iter|
iter.each do |hit|
raise BLASTDBError if hit.hit_id =~ /\|BL_ORD_ID\|/
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, splice_sites, exons,
expected = :yes)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, query_length, limits,
expected = :yes)
Method conclude
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def conclude
if @result == :yes
'There is no evidence based on the top 10 BLAST hits to suggest any' \
' problems with the query sequence.'
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 check_validations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_validations(vals)
# check the class type of the elements in the list
vals.each { |v| raise ValidationClassError unless v.is_a? ValidationTest }
# check alias duplication
aliases = vals.map(&:cli_name)
- 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 conclude
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def conclude
if @unimodality
'This suggest that the query sequence represents a single gene.'
else
diff = @result == :yes ? ' within' : ' outside'
- 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
Function plot_simple_bars
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.plot_simple_bars = function (alldata, target, title, footer, xTitle, yTitle) {
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, slope, unimodality,
expected = :no)
Method general_overview
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def general_overview(o)
good_pred = o[:good_scores] == 1 ? 'One' : "#{o[:good_scores]} are"
bad_pred = o[:bad_scores] == 1 ? 'One' : "#{o[:bad_scores]} are"
plural = 'prediction was' if o[:insufficient_BLAST_hits] == 1
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run
# Run BLAST on all sequences (generates @opt[:blast_xml_file])
# if no BLAST OUTPUT file provided...
unless @opt[:blast_xml_file] || @opt[:blast_tabular_file]
blast_xml_fname = "#{dirs[:filename]}.blast_xml"
- 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
Consider simplifying this complex logical expression. Open
if cond1_x && cond2_x && cond3_x && cond1_y && cond2_y && cond3_y
true
else
false
end
Method check_multiple_coverage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_multiple_coverage(hit_alignment, query_alignment, hsp, coverage,
ranges_prediction)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, frames,
expected = :yes)
Method run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run
raise NotEnoughHitsError if hits.length < opt[:min_blast_hits]
raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
start = 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 get_orfs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_orfs(_orf_length = 100, prediction = @prediction)
'-' if prediction.type != 'nucleotide'
seq = Bio::Sequence::NA.new(prediction.raw_sequence)
- 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"