Showing 1,637 of 1,651 total issues
Method has too many lines. [12/10] Open
def parse_cli
cli.parse do |opt|
opt.on(
'-o', '--tarball PATH',
'(Mandatory) Path to the archive to be created ending in .tar.gz'
- 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. [12/10] Open
def check_dist_eval(cli, p, res)
y = { notok: Set.new, fix: Set.new }
Zlib::GzipReader.open(res.file_path(:matrix)) do |fh|
lineno = 0
fh.each_line do |ln|
- 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_files is too high. [17.58/15] 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
- 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. [12/10] Open
def add_file_to_tar(tar, rel_path, abs_path)
if File.directory? abs_path
Dir["#{abs_path}/*"].each do |f|
add_file_to_tar(tar, File.join(rel_path, File.basename(f)), f)
end
- 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 initialize_empty_project is too high. [17.15/15] Open
def initialize_empty_project(metadata)
call_cli(
['new', '-P', cli[:outdir], '-t', cli[:project_type]]
) unless MiGA::Project.exist? cli[:outdir]
- 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 create_project is too high. [17.46/15] Open
def create_project(stage, p_metadata = {}, d_metadata = {})
cli.ensure_par(
outdir: '-o',
project_type: '--project-type',
dataset_type: '--dataset-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
Cyclomatic complexity for get_files_and_type is too high. [8/6] Open
def get_files_and_type
files = cli.files
file_type = nil
if files.empty?
cli.ensure_par({ dataset: '-D' },
- 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.
Cyclomatic complexity for perform is too high. [8/6] Open
def perform
r = cli.load_result or return
cli[:compute] = false if cli[:try_load] && !r[:stats]&.empty?
- 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.
Perceived complexity for create_dataset is too high. [9/7] 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 tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points
Method has too many lines. [12/10] Open
def summarize(which = %w[cds assembly essential_genes ssu])
return if cli[:prepare_and_exit]
which.each do |r|
cli.say "Summary: #{r}"
- 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 create_dataset is too high. [8/6] 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 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.
Cyclomatic complexity for run_daemon is too high. [8/6] Open
def run_daemon
return if cli[:prepare_and_exit]
cmd = ['daemon', 'run', '-P', cli[:outdir], '--shutdown-when-done']
cmd += ['--json', cli[:daemon_json]] if cli[:daemon_json]
- 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.
Perceived complexity for perform is too high. [9/7] Open
def perform
r = cli.load_result or return
cli[:compute] = false if cli[:try_load] && !r[:stats]&.empty?
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points
Assignment Branch Condition size for representatives is too high. [17.15/15] Open
def representatives(p)
cli.say 'Identifying representatives'
f = File.join(cli[:outdir], 'representatives.txt')
if cli[:criterion] == :medoids
FileUtils.cp(p.result(:clade_finding).file_path(:medoids_gsp), f)
- 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. [12/10] Open
def check_libraries(paths)
req_libraries = {
r: %w[ape cluster vegan],
ruby: %w[sqlite3 daemons json],
python: %w[numpy sqlite3 pyhmmer pyrodigal]
- 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 version_requested is too high. [17.38/15] Open
def version_requested(db)
cli[:version] = db[:latest].to_sym if cli[:version] == :latest
ver = db[:versions][cli[:version]]
raise 'Cannot find database version' if ver.nil?
ver[:version] = cli[:version]
- 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 check_and_install_library is too high. [17.15/15] Open
def check_and_install_library(paths, language, library)
cli.print "Testing #{library}... "
if test_library(cli, paths, language, library)
cli.puts 'yes'
else
- 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 download_file is too high. [17.49/15] Open
def download_file(ftp, path, reuse = false)
cli.say "Downloading '#{path}'"
file = File.expand_path(path, cli[:local])
if reuse && File.exist?(file)
cli.say "Reusing #{file}"
- 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. [12/10] Open
def ncbi_map(id, dbfrom, db)
doc = download(:ncbi_map, dbfrom, id, :json, nil, db: db)
return if doc.empty?
begin
- 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 recalculate_status is too high. [17.83/15] Open
def recalculate_status(save = true)
old_status = metadata[:status]
metadata[:status] =
!active? ? 'inactive' : done_preprocessing? ? 'complete' : 'incomplete'
if save && (old_status.nil? || old_status != metadata[:status])
- 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