Showing 186 of 1,651 total issues
Method download_file_ftp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def download_file_ftp(connection, file = nil, target = nil)
# Open connection unless passed
close_conn = false
if connection.is_a?(String) || connection.is_a?(Symbol) ||
connection.is_a?(URI)
- 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_bidirectional
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. 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
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_files_and_type
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_files_and_type
files = cli.files
file_type = nil
if files.empty?
cli.ensure_par({ dataset: '-D' },
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def remote_list
cli.say 'Downloading genome list'
current_page = 1
total_pages = 1
ds = {}
- 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 next_task
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def next_task(tasks = nil, save = false)
tasks ||= result_dirs.keys
tasks.find do |t|
if ignore_task?(t)
# Do not run if this step is to be ignored
- 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 opt_object
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def opt_object(opt, what = %i[project dataset])
what.each do |w|
case w
when :project
opt.on(
- 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 a Cognitive Complexity of 15 (exceeds 5 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)
- 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_directories
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def check_directories
each_project do |project|
d = project_daemon(project)
next if d.active?
- 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 compute_stats_ssu
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compute_stats_ssu
stats = {
ssu: 0, complete_ssu: 0, ssu_fragment: [0.0, '%'],
lsu: 0, complete_lsu: 0, lsu_fragment: [0.0, '%']
}
- Create a ticketCreate a ticket
Method opt_object
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def opt_object(opt, what = %i[project dataset])
what.each do |w|
case w
when :project
opt.on(
- Create a ticketCreate a ticket
Method run_cmd
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_cmd(cmd, opts = {})
opts = run_cmd_opts(opts)
cmd = cmd.shelljoin if cmd.is_a?(Array)
spawn_opts = {}
spawn_opts[:out] = opts[:stdout] if opts[:stdout]
- Create a ticketCreate a ticket
Method parse_cli
has 44 lines of code (exceeds 25 allowed). Consider refactoring. 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)
- Create a ticketCreate a ticket
Method clean_fasta_file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def clean_fasta_file(file, min_len = 1)
tmp_fh = nil
tmp_path = nil
begin
if file =~ /\.gz/
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def perform
p = cli.load_project
if not cli[:datum].nil?
v = p.metadata[cli[:datum]]
cli.puts v.nil? ? '?' : v
- 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 14 (exceeds 5 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')
- 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_project
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def each_project(dir = path)
Dir.entries(dir).each do |f|
next if %w[. ..].include?(f) # Ruby <= 2.3 doesn't have Dir.children
f = File.join(dir, f)
- 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 unregistered_datasets
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. 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
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_dist_eval
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def check_dist_eval(cli, p, res)
y = { notok: Set.new, fix: Set.new }
Zlib::GzipReader.open(res.file_path(:matrix)) do |fh|
lineno = 0
fh.each_line do |ln|
- 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 reference_db
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. 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
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 clean_fasta_file
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def clean_fasta_file(file, min_len = 1)
tmp_fh = nil
tmp_path = nil
begin
if file =~ /\.gz/
- Create a ticketCreate a ticket