Showing 1,637 of 1,651 total issues
Method add_metadata
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_metadata(obj, cli = self)
raise "Unsupported object: #{obj.class}" unless obj.respond_to? :metadata
(cli[:metadata] || '').split(',').each do |pair|
(k, v) = pair.split('=')
- Create a ticketCreate a ticket
Method perform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
unless cli[:value].nil?
cli.ensure_par(
{ key: '-k' },
'%<name>s is mandatory when --value is set: provide %<flag>s'
- Create a ticketCreate a ticket
Method parse_cli
has 26 lines of code (exceeds 25 allowed). Consider refactoring. 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)
- Create a ticketCreate a ticket
Method ncbi_asm_get
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ncbi_asm_get(opts)
require 'tempfile'
require 'zip'
zipped = download(
- Create a ticketCreate a ticket
Method perform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
cli.ensure_par(result: '-r')
ds = cli.load_and_filter_datasets
cli.say 'Loading results'
k = 0
- Create a ticketCreate a ticket
Block has too many lines. [33/25] Open
cli.parse do |opt|
cli.opt_object(opt, [:project, :project_type_req])
opt.on(
'-n', '--name STRING',
'Name of the project'
- 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.
Method net_method
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. 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
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 format_result_stats
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def format_result_stats(res)
res.stats.map do |k, v|
v = [v, ''] unless v.is_a? Array
v[0] = ('%.3g' % v[0]) if v[0].is_a? Float
"<b>#{format_name(k)}:</b> #{v[0]}#{v[1]}<br/>"
- 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 save_to
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save_to(project, name = nil, is_ref = true, metadata_def = {})
name ||= ids.join('_').miga_name
project = MiGA::Project.new(project) if project.is_a? String
MiGA::Dataset.exist?(project, name) and
raise "Dataset #{name} exists in the project, aborting..."
- 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 stop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stop(opts = [], wait = true)
if active?
say 'Sending termination message'
FileUtils.touch(terminate_file)
sleep(0.5) while active? if wait
- 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 configure_qsub_msub_daemon
has a Cognitive Complexity of 9 (exceeds 5 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
- 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 run_block
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run_block(&blk)
busy_attempts ||= 0
io_attempts ||= 0
SQLite3::Database.new(path) { |conn| blk[conn] }
rescue SQLite3::BusyException => e
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def merge_bidir_tmp(tmp)
tmp_done = File.join(tmp, 'chunks.txt')
chunks = File.readlines(tmp_done)[0].chomp.to_i
lower_tr = []
- 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 add_dataset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_dataset(name)
unless metadata[:datasets].include? name
d = MiGA::Dataset.new(self, name)
@metadata[:datasets] << name
@dataset_names_hash[name] = true if @dataset_names_hash
- 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 closest_relative_tax
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def closest_relative_tax(cr)
cli.puts "Closest relative: #{cr[0]} with AAI: #{cr[1]}."
p = cli.load_project
if cli[:ref_project]
if (ref = p.option(:ref_project)).nil?
- 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 save_entry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save_entry(name, body, p)
cli.say " Locating remote dataset: #{name}"
body[:md][:metadata_only] = true if cli[:only_md]
rd = MiGA::RemoteDataset.new(body[:ids], body[:db], body[:universe])
if cli[:get_md]
- 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 each_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. 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
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 9 (exceeds 5 allowed). Consider refactoring. Open
def perform
if cli[:result] && r = cli.load_result
cli[:remove] ? r.remove! : r.unlink
elsif d = cli.load_dataset
cli.load_project.unlink_dataset(d.name)
- 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 run_daemon
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. 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
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 download_opts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
universe, db, ids, format, file = nil, extra = {}, obj = nil)
- Create a ticketCreate a ticket