Showing 1,637 of 1,651 total issues
Method has too many lines. [14/10] 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
- 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 ask_user is too high. [19.21/15] 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
- 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. [14/10] Confirmed
def get_gtdb_taxonomy
gtdb_genome = metadata[:gtdb_assembly] or return
doc = MiGA::Json.parse(
MiGA::RemoteDataset.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.
Assignment Branch Condition size for get_metadata is too high. [19.31/15] Open
def get_metadata(metadata_def = {})
metadata_def.each { |k, v| @metadata[k] = v }
return @metadata if @metadata[:bypass_metadata]
case universe
- 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 get_ncbi_taxid_from_ncbi is too high. [19.62/15] Open
def get_ncbi_taxid_from_ncbi
# Try first from Assembly data
return get_ncbi_taxid_from_web if db == :assembly
# Try from previously pulled NCBI data
- 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_type_status_ncbi_asm is too high. [10/6] 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
- 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. [14/10] Confirmed
def save_assembly_to(project, name, udb)
dir = MiGA::Dataset.RESULT_DIRS[:assembly]
base = "#{project.path}/data/#{dir}/#{name}"
l_ctg = "#{base}.LargeContigs.fna"
a_ctg = "#{base}.AllContigs.fna"
- 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. [14/10] Open
def unregistered_datasets
datasets = []
MiGA::Dataset.RESULT_DIRS.values.each do |dir|
dir_p = "#{path}/data/#{dir}"
next unless Dir.exist? dir_p
- 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 runopts is too high. [10/6] Open
def runopts(k, v = nil, force = false)
k = k.to_sym
unless v.nil?
case k
when :latency, :maxjobs, :ppn, :ppn_project, :format_version, :verbosity,
- 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. [14/10] Open
def each_file(&blk)
return to_enum(:each_file) unless block_given?
@data[:files] ||= {}
self[:files].each do |k, files|
- 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. [14/10] Open
def create
unless MiGA::MiGA.initialized?
warn 'Projects cannot be processed yet, first run: miga init'
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. [19.92/15] Open
def parse_cli
cli.defaults = { metric: :aai, external: false, how_many: 5 }
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
Assignment Branch Condition size for add_result is too high. [19.82/15] Open
def add_result(task, save = true, opts = {})
task = task.to_sym
return nil if result_dirs[task].nil?
base = File.join(project.path, 'data', result_dirs[task], result_base)
- 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. [14/10] Open
def pull_hook(event, *event_args)
event = event.to_sym
event_queue = (hooks[event] || [])
event_queue += (metadata[event] || []) if respond_to? :metadata
event_queue.each do |i|
- 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 remote_connection is too high. [19.87/15] 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 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 assert_valid_option_value is too high. [19.42/15] Open
def assert_valid_option_value(key, value, from_string = false)
opt = assert_has_option(key)
value = option_from_string(key, value) if from_string
# nil is always valid, and so are supported tokens
- 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. [14/10] Open
def parse_cli
cli.parse do |opt|
cli.opt_object(opt, [:project])
cli.opt_filter_datasets(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.
Method has too many lines. [14/10] Open
def parse_cli
cli.defaults = { format: :json }
cli.parse do |opt|
cli.opt_object(opt, [:project])
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. [14/10] Open
def net_method(method, uri, *opts)
attempts ||= 0
uri = URI.parse(uri) if uri.is_a? String
DEBUG "#{method.to_s.upcase}: #{uri} #{opts}"
case method.to_sym
- 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. [19.31/15] Open
def parse_cli
cli.parse do |opt|
cli.opt_object(opt, [:project, :project_type_req])
opt.on(
'-n', '--name STRING',
- 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