Showing 1,637 of 1,651 total issues
Method perform
has a Cognitive Complexity of 12 (exceeds 5 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]
- 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 runopts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. 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
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 check_software_requirements
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def check_software_requirements(rc_fh)
cli.puts 'Looking for requirements:'
opt_groups = {
mytaxa: 'MyTaxa',
rdp: 'RDP classifier',
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def partial_bidir_tmp(project, ref_ds)
n = ref_ds.size
chunks = partial_bidir_chunks(n)
# Check first if a previous run is complete (and recover it)
- Create a ticketCreate a ticket
Method traverse_taxonomy
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def traverse_taxonomy(tab, dist)
cli.say 'Traversing taxonomy'
rank_i = 0
Taxonomy.KNOWN_RANKS.each do |rank|
next if rank == :ns
- Create a ticketCreate a ticket
Method remote_list
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remote_list
cli.say 'Downloading genome list'
current_page = 1
total_pages = 1
ds = {}
- Create a ticketCreate a ticket
Method compute_stats_taxonomy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def compute_stats_taxonomy
stats = {}
return stats unless file_path(:intax_test)
File.open(file_path(:intax_test), 'r') do |fh|
- 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_ncbi_taxonomy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_ncbi_taxonomy
tax_id = get_ncbi_taxid or return
if self.class.ncbi_taxonomy_dump?
return self.class.taxonomy_from_ncbi_dump(tax_id)
- 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 use_ncbi_taxonomy_dump
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def use_ncbi_taxonomy_dump(path, cli = nil)
raise "Directory doesn't exist: #{path}" unless File.directory?(path)
# Structure: { TaxID => ["name", "rank", parent TaxID] }
MiGA::MiGA.DEBUG "Loading NCBI Taxonomy dump: #{path}"
- 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 launch_job
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def launch_job(job, hostk = nil)
# Execute job
job[:cmd] = job_cmd(job)
MiGA::MiGA.DEBUG "CMD: #{job[:cmd]}"
case runopts(:type)
- 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 load_and_filter_datasets
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_and_filter_datasets(silent = false)
return @objects[:filtered_datasets] unless @objects[:filtered_datasets].nil?
say 'Listing datasets'
ds =
- Create a ticketCreate a ticket
Method test_start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_start
p = project
d = daemon
d.runopts(:latency, 0, true)
assert_equal(0, d.latency)
- Create a ticketCreate a ticket
Method perform
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
p = cli.load_project
if !cli[:taxfile].nil?
cli.say 'Reading tax-file and registering taxonomy'
tfh = File.open(cli[:taxfile], 'r')
- Create a ticketCreate a ticket
Method configure_ssh_daemon
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure_ssh_daemon(v)
v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '3').to_i
v[:nodelist] = cli.ask_user(
'What environmental variable points to node list?', '$MIGA_NODELIST'
)
- Create a ticketCreate a ticket
Method configure_bash_daemon
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure_bash_daemon(v)
v[:latency] = cli.ask_user('How long should I sleep? (in secs)', '2').to_i
v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '6').to_i
v[:ppn] = cli.ask_user('How many CPUs can I use per job?', '2').to_i
v[:nodelist] = nil # <- To enable non-default with default SSH
- Create a ticketCreate a ticket
Method get_sub_cli
has 29 lines of code (exceeds 25 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']
- Create a ticketCreate a ticket
Method import_dataset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_dataset(ds, method = :hardlink)
raise "Impossible to import dataset, it already exists: #{ds.name}." if
MiGA::Dataset.exist?(self, ds.name)
# Import dataset results
- Create a ticketCreate a ticket
Method check_software_requirements
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_software_requirements(rc_fh)
cli.puts 'Looking for requirements:'
opt_groups = {
mytaxa: 'MyTaxa',
rdp: 'RDP classifier',
- Create a ticketCreate a ticket
Method get_type_status_ncbi_asm
has 28 lines of code (exceeds 25 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]
- Create a ticketCreate a ticket
Method cli_save_actions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cli_save_actions(opt)
cli.opt_flag(
opt, 'only-metadata',
'Create datasets without input data but retrieve all metadata',
:only_md
- Create a ticketCreate a ticket