Showing 1,637 of 1,651 total issues
Block has too many lines. [41/25] Open
cli.parse do |opt|
opt.on(
'-n', '--database STRING',
"Name of the database to download. By default: #{cli[:database]}"
) { |v| cli[:database] = v.to_sym }
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [41/25] Open
cli.parse do |opt|
opt.on(
'-c', '--config PATH',
'Path to the Bash configuration file',
"By default: #{cli[:config]}"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for initialize is too high. [15.13/15] Open
def initialize(project, name, is_ref = true, metadata = {})
name = name.to_s
name.miga_name? or
raise 'Invalid name, please use only alphanumerics and underscores: ' +
name
- 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 ignore_by_type? is too high. [15.52/15] Open
def ignore_by_type?(task, type)
return false if force_task?(task)
test, list =
case type.to_sym
- 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 advance
has 41 lines of code (exceeds 25 allowed). Consider refactoring. 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
- Create a ticketCreate a ticket
Method load_status
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def load_status
f_path = File.join(daemon_home, 'status.json')
return unless File.size? f_path
say 'Loading previous status in daemon/status.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 perform
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. 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
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 test_preprocessing
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_preprocessing
d2 = project.add_dataset('ds_preprocessing')
assert_nil(d2.first_preprocessing)
assert_nil(d2.next_preprocessing)
assert_not_predicate(d2, :done_preprocessing?)
- Create a ticketCreate a ticket
Method opt_filter_datasets
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def opt_filter_datasets(opt, what = %i[ref multi markers active taxonomy])
what.each do |w|
case w
when :ref
opt.on(
- Create a ticketCreate a ticket
Method parse_cli
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
default_opts_for_wf
cli.defaults = {
metric: :ani, threshold: 95.0, criterion: :quality,
summaries: true, collection: true
- Create a ticketCreate a ticket
Method compute_stats_essential_genes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compute_stats_essential_genes
stats = {}
if source.multi?
stats = { median_copies: 0, mean_copies: 0 }
File.open(file_path(:report), 'r') do |fh|
- Create a ticketCreate a ticket
Method perform
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
ds = cli.load_and_filter_datasets(cli[:silent])
p = cli.load_project
exit(ds.empty? ? 1 : 0) if cli[:silent]
- Create a ticketCreate a ticket
Method parse_cli
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.expect_files = true
cli.files_label = 'CMD'
cli.defaults = {
raise: false, return: :status, source: :miga_env,
- Create a ticketCreate a ticket
Method configure_slurm_daemon
has 36 lines of code (exceeds 25 allowed). Consider refactoring. 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
- Create a ticketCreate a ticket
Method parse_cli
has 36 lines of code (exceeds 25 allowed). Consider refactoring. 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'])
- Create a ticketCreate a ticket
Method create_dataset
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. 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
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_type_status_ncbi_asm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_type_status_ncbi_asm(metadata)
from_type = nil
# Try first from previously pulled NCBI metadata
if metadata[:ncbi_dataset]
- 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 merge_bidir_tmp_cell
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def merge_bidir_tmp_cell(dist_x, dist_y)
# Find missing values
dist = {}
datasets = Set.new
dist_x.each do |metric, distances_x|
- 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 remote_list
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def remote_list
if cli[:ncbi_list_json] && File.size?(cli[:ncbi_list_json])
return read_ncbi_list_json(cli[:ncbi_list_json])
end
- 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 ask_user
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def ask_user(question, default = nil, answers = nil, force = false)
ans = " (#{answers.join(' / ')})" unless answers.nil?
dft = " [#{default}]" unless default.nil?
print "#{question}#{ans}#{dft} > "
if self[:auto] && !force
- 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"