Showing 1,637 of 1,651 total issues
Method perform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def perform
# Input data
norun = %w[
project_stats haai_distances aai_distances ani_distances clade_finding
]
- 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 last_alive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def last_alive(path)
f = alive_file(path)
f = terminated_file(path) unless File.exist? f
c = File.read(f)
return nil if c.nil? || c.empty?
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def perform
cli.files
cli.say 'Running command:'
cmd = cli.files.size == 1 ? cli.files[0] : cli.files
cli.say cmd
- 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_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_type
raise MiGA::Error.new('Undefined dataset type') unless type
return false if type == :empty
unless self.class.KNOWN_TYPES[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
Block has too many lines. [28/25] Open
Gem::Specification.new do |s|
# Basic information
s.name = 'miga-base'
s.version = MiGA::MiGA.FULL_VERSION
s.date = MiGA::MiGA.VERSION_DATE.to_s
- 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 add_result_ssu
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_result_ssu(base, opts)
return MiGA::Result.new("#{base}.json") if result(:assembly).nil?
return nil unless result_files_exist?(base, '.ssu.fa')
r = add_files_to_ds_result(
- 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
Avoid too many return
statements within this method. Open
check_target and return
- Create a ticketCreate a ticket
Block has too many lines. [27/25] Open
Taxonomy.KNOWN_RANKS.each do |rank|
next if rank == :ns
rank_n = 0
rank_i += 1
- 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.
Block has too many lines. [27/25] Open
cli.parse do |opt|
opt.separator 'To separate command flags from MiGA flags, use --:'
opt.separator 'miga cmd --verbose -- rbm.rb --version'
opt.separator ''
opt.separator 'To run the command as is (no escaping), use single-quotes:'
- 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.
Avoid parameter lists longer than 5 parameters. [7/5] Open
def download_opts(
universe, db, ids, format, file = nil, extra = {}, obj = nil)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.
Method save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save
return if self[:never_save]
return if !saved_hash.nil? && saved_hash == data.hash
MiGA::MiGA.DEBUG "Metadata.save #{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 initialize_by_ranks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize_by_ranks(str, ranks)
ranks = ranks.split(/\s+/) unless ranks.is_a? Array
str = str.split(/\s+/) unless str.is_a? Array
unless ranks.size == str.size
raise "Unequal number of ranks and names: #{ranks} => #{str}"
- 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 list_local
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def list_local
local_manif = local_manifest
raise "Local manifest not found." unless local_manif
databases =
if %i[recommended test].include?(cli[:database])
- 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 num_suffix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def num_suffix(n, bin = false)
p = ''
{ T: 4, G: 3, M: 2, K: 1 }.each do |k, x|
v = (bin ? 1024 : 1e3)**x
if n > 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 aai_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def aai_path(test, opts = {})
opts[:engine] ||= :blast
engine = opts[:engine].to_s.downcase.to_sym
test = test.to_s.downcase.to_sym
return nil unless %i[intax novel].include? test
- 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 assert_valid_option_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. 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
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_alternative
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_alternative(tax, replace = true)
return if tax.nil?
raise 'Unsupported taxonomy class.' unless tax.is_a? MiGA::Taxonomy
alt_ns = alternative(tax.namespace)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def perform
cli.ensure_par(result: '-r')
obj = cli.load_project_or_dataset
cli.say "Registering result: #{cli[:result]}"
r = obj.add_result(cli[:result], true, force: cli[:force])
- 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_reports_as_datasets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_reports_as_datasets(reports)
ds = {}
reports.each do |r|
asm = r[:accession]
next if asm.nil? || asm.empty? || asm == '-'
- 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_taxid_from_ncbi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. 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
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"