Showing 838 of 1,651 total issues
Method configure_qsub_msub_daemon
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure_qsub_msub_daemon(v)
flavor = v[:type] == 'msub' ? 'msub' :
cli.ask_user('Select qsub flavor', 'torque', %w[torque sge])
queue = cli.ask_user('What queue should I use?', nil, nil, true)
v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '150').to_i
- Create a ticketCreate a ticket
Assignment Branch Condition size for test_preprocessing is too high. [26.31/15] Open
def test_preprocessing
p1 = project
assert_predicate(p1, :done_preprocessing?)
d1 = p1.add_dataset('BAH')
assert_not_predicate(p1, :done_preprocessing?)
- 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_taxonomy is too high. [26.08/15] 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 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_aai_taxtest is too high. [26.31/15] Open
def test_aai_taxtest
distant_intax = MiGA::TaxDist.aai_taxtest(35.0, :intax, engine: :diamond)
assert_equal(:root, distant_intax[:most_likely][0])
assert_equal(:d, distant_intax[:probably][0])
assert_nil(distant_intax[:possibly_even])
- 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. [21/10] Open
def test_dataset_result_hooks
$res = :test
$counter = 1
dataset.add_hook(:on_result_ready, :run_lambda, Proc.new { |r| $res = r })
dataset.add_hook(
- 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. [21/10] Open
def test_generic_transfer
hello = File.expand_path('Hello', tmpdir)
world = File.expand_path('World', tmpdir)
assert_respond_to(File, :generic_transfer)
FileUtils.touch(hello)
- 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. [21/10] 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 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 advance is too high. [17/6] Open
def advance(step, n = 0, total = nil, bin = true)
# Initialize advance timing
@_advance_time ||= { last: nil, n: 0, avg: nil, total: total }
if @_advance_time[:n] > n || total != @_advance_time[:total]
@_advance_time[:last] = nil
- 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 configure_slurm_daemon is too high. [26.93/15] Open
def configure_slurm_daemon(v)
queue = cli.ask_user('What queue should I use?', nil, nil, true)
v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '150').to_i
v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '300').to_i
v[:ppn] = cli.ask_user('How many CPUs can I use per job?', '2').to_i
- 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 save_bidirectional is too high. [26.94/15] Open
def save_bidirectional(a, dist)
each_database_file(a) do |db_file, metric, result, rank|
next if rank == :haai # No need for hAAI to be bidirectional
next if result == :taxonomy # Taxonomy is never bidirectional
- 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_configuration_script is too high. [26.25/15] Open
def check_configuration_script(rc_fh)
unless File.exist? cli[:config]
cli[:config] = cli.ask_user(
'Is there a script I need to load at startup?',
cli[:config]
- 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. [21/10] Open
def opts_for_wf_distances(opt)
opt.on('--sensitive', 'Alias to: --aai-p blast+ --ani-p blast+') do
cli[:aai_p] = 'blast+'
cli[:ani_p] = 'blast+'
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 parse_cli is too high. [26.93/15] Open
def parse_cli
cli.defaults = { info: false, processing: false, silent: false }
cli.parse do |opt|
cli.opt_object(opt, [:project, :dataset_opt])
cli.opt_filter_datasets(opt)
- 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. [21/10] Open
def generate_summary_page(path, p)
b = File.basename(path, '.tsv')
table = '<table class="table table-hover table-responsive">'
File.open(path, 'r') do |fh|
fh.each 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 perform is too high. [26.27/15] Open
def perform
p = cli.load_project
cli.ensure_par(type: '-t')
files, file_type = get_files_and_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. [21/10] Open
def format_results(obj)
o = ''
obj.each_result do |key, res|
links = format_result_links(res)
stats = format_result_stats(res)
- 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_digest is too high. [26.98/15] Open
def check_digest(ver, file)
cli.say 'Checking MD5 digest'
cli.say "Expected: #{ver[:MD5]}"
md5 = Digest::MD5.new
size = File.size(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. [21/10] Open
def reference_db
cli.say "Locating reference database"
ref_db_path = cli[:db_path]
if ref_db_path.nil?
if cli[:download]
- 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. [21/10] Open
def parse_cli
cli.defaults = {
query: false, unlink: false,
reference: false, add_version: true, dry: false,
get_md: false, only_md: false, save_every: 1
- 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. [21/10] Open
def parse_cli
cli.defaults = { info: false, force: false, method: :hardlink }
cli.parse do |opt|
cli.opt_object(opt, [:project, :dataset_opt])
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.