Showing 1,637 of 1,651 total issues
Method check_mts
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_mts(cli)
cli.say 'Looking for unarchived MyTaxa Scan runs'
cli.load_project.each_dataset do |d|
res = d.result(:mytaxa_scan)
next if res.nil?
- Create a ticketCreate a ticket
Method opt_common
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def opt_common(opt)
return unless @opt_common
if interactive
opt.on(
- Create a ticketCreate a ticket
Method declare_alive_loop
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def declare_alive_loop(pid = Process.ppid)
i = -1
loop do
i += 1
return :no_home unless Dir.exist? daemon_home
- Read upRead up
- Create a ticketCreate a ticket
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 opts_for_wf
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def opts_for_wf(opt, files_desc, params = {})
{
multi: false, cleanup: true, project_type: false, ncbi: true, qual: true
}.each { |k, v| params[k] = v if params[k].nil? }
opt.on(
- Read upRead up
- Create a ticketCreate a ticket
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_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_files(cli)
cli.say 'Looking for outdated files in results'
n, k = cli.load_project.dataset_names.size, 0
cli.load_project.each_dataset do |d|
cli.advance('Datasets:', k += 1, n, false)
- Read upRead up
- Create a ticketCreate a ticket
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 find_software
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_software(exec)
path = nil
loop do
d_path = File.dirname(run_cmd(cli, ['which', exec], raise: false))
if cli[:ask] || d_path == '.'
- Read upRead up
- Create a ticketCreate a ticket
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 ncbi_asm_acc2id
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ncbi_asm_acc2id(acc, retrials = 3)
return acc if acc =~ /^\d+$/
search_doc = MiGA::Json.parse(
download(:ncbi_search, :assembly, acc, :json),
- Read upRead up
- Create a ticketCreate a ticket
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 compute_stats_cds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compute_stats_cds
s = MiGA::MiGA.seqs_length(file_path(:proteins), :fasta)
stats = {
predicted_proteins: s[:n],
average_length: [s[:avg], 'aa']
- Read upRead up
- Create a ticketCreate a ticket
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 read_distances
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_distances
p = cli.load_project
cli[:metric] ||= p.clade? ? 'ani' : 'aai'
res_n = "#{cli[:metric]}_distances"
cli.say "Reading distances: 1-#{cli[:metric].upcase}"
- Read upRead up
- Create a ticketCreate a ticket
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_ess
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_ess(cli)
cli.say 'Looking for outdated essential genes'
cli.load_project.each_dataset do |d|
res = d.result(:essential_genes)
next if res.nil?
- Read upRead up
- Create a ticketCreate a ticket
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_cds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_cds(cli)
cli.say 'Looking for unzipped genes or proteins'
n, k = cli.load_project.dataset_names.size, 0
cli.load_project.each_dataset do |d|
cli.advance('Datasets:', k += 1, n, false)
- Read upRead up
- Create a ticketCreate a ticket
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 use_ncbi_taxonomy_dump
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def use_ncbi_taxonomy_dump(path, cli = nil)
raise "Directory doesn't exist: #{path}" unless File.directory?(path)
# Structure: { TaxID => ["name", "rank", parent TaxID] }
MiGA::MiGA.DEBUG "Loading NCBI Taxonomy dump: #{path}"
- Create a ticketCreate a ticket
Method ncbi_asm_json_doc
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ncbi_asm_json_doc
return @_ncbi_asm_json_doc unless @_ncbi_asm_json_doc.nil?
if db == :assembly && %i[ncbi gtdb seqcode].include?(universe)
metadata[:ncbi_asm] ||= ids.first
- Create a ticketCreate a ticket
Method check_db
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_db(cli)
cli.say 'Checking integrity of databases'
p = cli.load_project
n = p.dataset_names.size
(0 .. cli[:threads] - 1).map do |i|
- Create a ticketCreate a ticket
Method test_preprocessing
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_preprocessing
p1 = project
assert_predicate(p1, :done_preprocessing?)
d1 = p1.add_dataset('BAH')
assert_not_predicate(p1, :done_preprocessing?)
- Create a ticketCreate a ticket
Method test_check_datasets
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_check_datasets
p = project
d = daemon
d.runopts(:maxjobs, 0, true)
assert_empty(d.jobs_to_run)
- Create a ticketCreate a ticket
Method parse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(path, opts = {})
opts = default_opts(opts)
# Read JSON
cont = path
- Create a ticketCreate a ticket
Method merge_bidir_tmp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_bidir_tmp(tmp)
tmp_done = File.join(tmp, 'chunks.txt')
chunks = File.readlines(tmp_done)[0].chomp.to_i
lower_tr = []
- Create a ticketCreate a ticket
Method get_files_and_type
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_files_and_type
files = cli.files
file_type = nil
if files.empty?
cli.ensure_par({ dataset: '-D' },
- Create a ticketCreate a ticket
Method parse_cli
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.defaults = { units: false, tabular: false }
cli.parse do |opt|
cli.opt_object(opt, [:project, :dataset_opt])
cli.opt_filter_datasets(opt)
- Create a ticketCreate a ticket