Showing 160 of 1,471 total issues
Method compute_stats_ssu
has a Cognitive Complexity of 33 (exceeds 5 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, '%']
}
- 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 seqs_length
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def seqs_length(file, format, opts = {})
opts[:gc] = true if opts[:skew]
fh = file =~ /\.gz/ ? Zlib::GzipReader.open(file) : File.open(file, 'r')
l = []
gc = 0
- 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 opts_for_wf
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def opts_for_wf(opt, files_desc, params = {})
{
multi: false, cleanup: true, project_type: false, ncbi: true, qual: true
}.each { |k, v| params[k] = v if params[k].nil? }
opt.on(
- Create a ticketCreate a ticket
File daemon_test.rb
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'test_helper'
require 'daemon_helper'
require 'miga/daemon'
class DaemonTest < Test::Unit::TestCase
- Create a ticketCreate a ticket
Method perform
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def perform
# Load environment variables if requested (typically by the daemon)
if cli[:env]
cli[:project] ||= ENV['PROJECT']
cli[:dataset] ||= ENV['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 perform
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def perform
cli.ensure_par(result: '-r')
ds = cli.load_and_filter_datasets
cli.say 'Loading results'
k = 0
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
def merge_bidir_tmp(tmp)
dist = { aai: {}, ani: {} }
cli[:threads].times do |i|
cli.advance('Merging:', i + 1, cli[:threads], false)
file = File.join(tmp, "#{i}.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 load_and_filter_datasets
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def load_and_filter_datasets(silent = false)
return @objects[:filtered_datasets] unless @objects[:filtered_datasets].nil?
say 'Listing datasets'
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 download_entries
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def download_entries(ds, p)
cli.say "Downloading #{ds.size} " + (ds.size == 1 ? 'entry' : 'entries')
p.do_not_save = true if cli[:save_every] != 1
ignore = !cli[:ignore_until].nil?
downloaded = 0
- 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 traverse_taxonomy
has a Cognitive Complexity of 23 (exceeds 5 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
- 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 74 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method add_metadata
has a Cognitive Complexity of 21 (exceeds 5 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('=')
- 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 parse_cli
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.defaults = { daemon_opts: [] }
cli.expect_operation = true
cli.parse do |opt|
opt.separator 'Available operations:'
- Create a ticketCreate a ticket
Class Daemon
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class MiGA::Daemon < MiGA::MiGA
include MiGA::Daemon::Base
include MiGA::Common::WithDaemon
extend MiGA::Common::WithDaemonClass
- Create a ticketCreate a ticket
Method parse_cli
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.defaults = { daemon_opts: [], show_log: false }
cli.expect_operation = true
cli.parse do |opt|
opt.separator 'Available operations:'
- Create a ticketCreate a ticket
Method advance
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def advance(step, n = 0, total = nil, bin = true)
# Initialize advance timing
@_advance_time ||= { last: nil, n: 0, avg: nil }
if @_advance_time[:n] > n
@_advance_time[:last] = 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 check_mts
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def check_mts(cli)
cli.say 'Looking for unarchived MyTaxa Scan runs'
cli.load_project.each_dataset do |d|
res = d.result(:mytaxa_scan)
next if res.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 perform
has a Cognitive Complexity of 19 (exceeds 5 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'
- 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_db
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def check_db(cli)
cli.say 'Checking integrity of databases'
p = cli.load_project
n = p.dataset_names.size
(0 .. cli[:threads] - 1).map do |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
Class DaemonTest
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class DaemonTest < Test::Unit::TestCase
include TestHelper
include DaemonHelper
def setup
- Create a ticketCreate a ticket