Showing 1,599 of 1,613 total issues
Assignment Branch Condition size for format_table is too high. [21.47/15] Open
def format_table(ds, header, &blk)
io = cli[:output].nil? ? $stdout : File.open(cli[:output], 'w')
cli.say 'Collecting metadata'
k = 0
cli.table(
- 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. [16/10] Open
def add_result_distances_nonref(base)
return nil unless
result_files_exist?(base, %w[.aai-medoids.tsv .aai.db]) ||
result_files_exist?(base, %w[.ani-medoids.tsv .ani.db]) ||
result_files_exist?(base, %w[.empty])
- 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. [16/10] Open
def install_library(cli, paths, language, pkg)
case language
when :r
r_cmd = "install.packages('#{pkg}', repos='http://cran.rstudio.com/')"
run_r_cmd(cli, paths, r_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.
File daemon.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'miga/project'
require 'miga/common/with_daemon'
require 'miga/daemon/base'
##
- Create a ticketCreate a ticket
File wf.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
module MiGA::Cli::Action::Wf
def default_opts_for_wf
cli.expect_files = true
cli.defaults = {
clean: false, project_type: :genomes, dataset_type: :popgenome,
- Create a ticketCreate a ticket
Method download_datasets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def download_datasets
# Download datasets from NCBI
unless cli[:ncbi_taxon].nil?
what = cli[:ncbi_ref] ? '--reference' :
cli[:ncbi_draft] ? '--all' : '--complete'
- 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 get_sub_cli
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_sub_cli
return [cli] if cli[:file].nil? || cli[:ignore_file]
glob = []
cli_default = cli.original_argv + ['--ignore-file']
- 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 aai_pvalues
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. 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
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 partial_bidir_tmp
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def partial_bidir_tmp(project, ref_ds)
n = ref_ds.size
# Read data first (threaded)
tmp = File.join(project.path, 'doctor-bidirectional.tmp')
- 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
Assignment Branch Condition size for test_single_raw_reads is too high. [20.22/15] Open
def test_single_raw_reads
dir = 'data/01.raw_reads'
fq = file_path(dir, '.1.fastq')
File.open(fq, 'w') { |fh| fh.puts '@1', 'ACTAC', '+', '####' }
touch_done(dir)
- 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. [15/10] Open
def test_taxonomy
# Prepare result
dir = 'data/09.distances/05.taxonomy'
FileUtils.touch(file_path(dir, '.aai-medoids.tsv'))
FileUtils.touch(file_path(dir, '.aai.db'))
- 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_defaults is too high. [20.1/15] Open
def test_defaults
tmp1 = Tempfile.new('test-parse-1.json')
tmp1.puts '{"a": 123, "k": false, "t": null}'
tmp1.close
assert_equal({ a: 123, k: false, t: nil }, MiGA::Json.parse(tmp1.path))
- 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. [15/10] Open
def test_profile_advance
d2 = project.add_dataset('ds_profile_advance')
assert_equal(0, d2.profile_advance(true).first)
assert_equal(0, d2.profile_advance(true).last)
assert_equal(0, d2.profile_advance(true).inject(:+))
- 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_unlink is too high. [20.4/15] Open
def test_unlink
r = project.add_result(:clade_finding)
path = r.path
done = r.path(:done)
data = r.file_path(:empty)
- 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. [15/10] Open
def test_load
md1 = MiGA::Metadata.new(tmpfile('md_load.json'), { t: 1 })
assert_equal(1, md1[:t])
declare_forks
- 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. [15/10] Open
def test_debug
assert_respond_to(MiGA::MiGA, :DEBUG)
assert_respond_to(MiGA::MiGA, :DEBUG_ON)
assert_respond_to(MiGA::MiGA, :DEBUG_OFF)
MiGA::MiGA.DEBUG_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. [15/10] Open
def save
return if self[:never_save]
return if !saved_hash.nil? && saved_hash == data.hash
MiGA::MiGA.DEBUG "Metadata.save #{path}"
- 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. [15/10] Open
def test_overwrite_result
r = dataset.add_result(:trimmed_reads)
r[:ephemeral] = '@'
r[:versions] = { you: 'best' }
r.save
- 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. [15/10] Open
def test_terminate
d = daemon
assert_not_predicate(d, :active?)
assert_path_not_exist(d.alive_file)
assert_path_not_exist(d.terminated_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. [15/10] 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 if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.