Showing 74 of 132 total issues
Method run_validations
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run_validations(iterator)
p = Pool.new(@opt[:num_threads]) if @opt[:num_threads] > 1
check_if_maker_input?
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def run(hits = @hits, prediction = @prediction)
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 initialize
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, msg, query_length,
no_of_hits, median, mean, smallest_hit, largest_hit,
extreme_hits, percentage)
Method multiple_align_mafft
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def multiple_align_mafft(prediction, hits)
raise unless prediction.is_a?(Query) && hits[0].is_a?(Query)
opt = ['--maxiterate', '1000', '--localpair', '--anysymbol', '--quiet',
'--thread', @num_threads.to_s]
- 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 addPlot
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
GV.addPlot = function (jsonData, target, type, title, footer, xtitle, ytitle, aux1, aux2) {
var legend;
if (footer === '') {
legend = [];
} else {
Method unimodality_test
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def unimodality_test(xx, yy)
mean_x = xx.mean
median_x = xx.median
mode_x = xx.mode
sd_x = xx.standard_deviation
Method plot_alignment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot_alignment(freq, ma = @multiple_alignment)
# get indeces of consensus in the multiple alignment
consensus = get_consensus(ma[0..ma.length - 2])
consensus_idxs = consensus.split(//).each_index.select { |j| isalpha(consensus[j]) }
consensus_ranges = array_to_ranges(consensus_idxs)
Function addPlot
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.addPlot = function (jsonData, target, type, title, footer, xtitle, ytitle, aux1, aux2) {
Method clusterization_by_length
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def clusterization_by_length(_debug = false,
lst = @hits,
predicted_seq = @prediction)
raise TypeError unless lst[0].is_a?(Query) && predicted_seq.is_a?(Query)
- 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_sm_pssm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_sm_pssm(ma, threshold = 0.7)
sm = ''
freq = []
(0..ma[0].length - 1).each do |i|
freqs = Hash.new(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 conclude
has 26 lines of code (exceeds 25 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
Method run
has 26 lines of code (exceeds 25 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
Method initialize
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(message = 'Not enough evidence', validation_result = :no,
short_header = '', header = '', description = '',
approach = '', explanation = '', conclusion = '')
Method initialize
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, orfs, coverage,
longest_orf_frame, threshold = 80, expected = :yes)
Method initialize
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(short_header, header, description, gaps = 0, extra_seq = 0,
consensus = 1, threshold = 20, expected = :yes)
Function plot_align
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.plot_align = function (data, target, title, footer, xTitle, yTitle, no_lines, yValues) {
Function plot_scatter
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.plot_scatter = function (data, target, title, footer, xTitle, yTitle, yLine, slope) {
Method overview_hash
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def overview_hash(scores_from_json, quartiles, nee, no_mafft, no_internet,
map_errors, run_time, insufficient_BLAST_hits)
Function plot_lines
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
GV.plot_lines = function (data, target, title, footer, xTitle, yTitle, no_lines, yValues) {
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(identifier, accession)
# first try to extract from previously created raw_sequences HASH
raw_seq = extract_from_index(accession) if opt[:raw_sequences]
# then try to just extract that sequence based on accession.
if opt[:db] !~ /remote/ && (raw_seq.nil? || raw_seq =~ /Error/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"