Showing 838 of 1,651 total issues
Method has too many lines. [20/10] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Cyclomatic complexity for perform is too high. [16/6] Open
def perform
# Load environment variables if requested (typically by the daemon)
if cli[:env]
cli[:project] ||= ENV['PROJECT']
cli[:dataset] ||= ENV['DATASET']
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Method has too many lines. [20/10] Open
def create_dataset(file, p)
name = cli[:dataset]
if name.nil?
ref_file = file.is_a?(Array) ? file.first : file
m = cli[:regexp].match(ref_file)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [20/10] Open
def parse_cli
cli.defaults = { try_load: false }
cli.parse do |opt|
cli.opt_object(opt, [:project, :dataset_opt, :result])
opt.on(
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [20/10] Open
def dereplicate(p)
return if cli[:prepare_and_exit]
cli.say 'Extracting genomospecies clades'
r = p.result(:clade_finding) or raise 'Result unavailable: run failed'
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for perform is too high. [25.57/15] Open
def perform
# Input data
ref_db = reference_db
norun = %w[
haai_distances aai_distances ani_distances clade_finding
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for perform is too high. [25.26/15] Open
def perform
cli.files
cli.say 'Running command:'
cmd = cli.files.size == 1 ? cli.files[0] : cli.files
cli.say cmd
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for parse_cli is too high. [25/15] Open
def parse_cli
default_opts_for_wf
cli.defaults = {
download: false, summaries: true, pvalue: 0.1,
local: File.expand_path('.miga_db', ENV['MIGA_HOME'])
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for list_local is too high. [25.67/15] Open
def list_local
local_manif = local_manifest
raise "Local manifest not found." unless local_manif
databases =
if %i[recommended test].include?(cli[:database])
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [20/10] Open
def unarchive(file, db_name)
cli.say "Unarchiving #{file}"
tmp_archive = File.join(cli[:local], '.TMP_ARCHIVE')
FileUtils.mkdir_p(tmp_archive)
MiGA::MiGA.run_cmd <<~CMD
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [20/10] Open
def add_result_mytaxa_scan(base, _opts)
if nonmulti?
return nil unless
result_files_exist?(base, %w[.pdf .mytaxa]) ||
result_files_exist?(base, '.nomytaxa.txt')
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for check_type is too high. [25.32/15] Open
def check_type
raise MiGA::Error.new('Undefined dataset type') unless type
return false if type == :empty
unless self.class.KNOWN_TYPES[type]
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [20/10] Open
def add_result_mytaxa(base, _opts)
if multi?
return nil unless
result_files_exist?(base, '.mytaxa') ||
result_files_exist?(base, '.nomytaxa.txt')
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for test_verbosity is too high. [24.52/15] Open
def test_verbosity
d1 = daemon
d1.runopts(:verbosity, 0)
out = capture_stderr { d1.in_loop }.string
assert_empty(out)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for test_next_host is too high. [24.33/15] Open
def test_next_host
d1 = daemon
f = tmpfile('nodes.txt')
File.open(f, 'w') { |h| h.puts 'localhost' }
assert_equal(true, d1.next_host)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for compute_stats_cds is too high. [24.06/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Cyclomatic complexity for ncbi_asm_json_doc is too high. [15/6] 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
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Assignment Branch Condition size for aai_pvalues is too high. [24.1/15] Open
def aai_pvalues(aai, test, opts = {})
y = {}
Zlib::GzipReader.open(aai_path(test, opts)) do |fh|
keys = nil
fh.each_line do |ln|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [19/10] Open
def next_task(tasks = nil, save = false)
tasks ||= result_dirs.keys
tasks.find do |t|
if ignore_task?(t)
# Do not run if this step is to be ignored
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [19/10] Open
def remote_connection(host)
host = known_hosts(host) if host.is_a?(Symbol)
uri = host.is_a?(URI) ? host : URI.parse(host)
@remote_connection_uri = uri
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.