Showing 185 of 1,638 total issues
Method parse
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def parse(path, opts = {})
opts = default_opts(opts)
# Read JSON
cont = 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 ncbi_asm_json_doc
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def ncbi_asm_json_doc
return @_ncbi_asm_json_doc unless @_ncbi_asm_json_doc.nil?
if db == :assembly && %i[ncbi gtdb seqcode].include?(universe)
metadata[:ncbi_asm] ||= ids.first
- 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 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
Method flush!
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def flush!
# Check for finished jobs
l_say(2, 'Checking for finished jobs')
@jobs_running.select! do |job|
ongoing =
- 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 tabulate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def tabulate(header, values, tabular = false)
fields = []
fields << header.map(&:to_s) unless tabular && header.all?(&:nil?)
fields << fields.first.map { |h| h.gsub(/\S/, '-') } unless tabular
fields += values.map { |r| r.map { |cell| cell.nil? ? '?' : cell.to_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 compute_stats_essential_genes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def compute_stats_essential_genes
stats = {}
if source.multi?
stats = { median_copies: 0, mean_copies: 0 }
File.open(file_path(:report), '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
File daemon.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'miga/project'
require 'miga/common/with_daemon'
require 'miga/daemon/base'
##
- Create a ticketCreate a ticket
File wf.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
module MiGA::Cli::Action::Wf
def default_opts_for_wf
cli.expect_files = true
cli.defaults = {
clean: false, project_type: :genomes, dataset_type: :popgenome,
- Create a ticketCreate a ticket
Method run_cmd
has a Cognitive Complexity of 17 (exceeds 5 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]
- 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_sub_cli
has a Cognitive Complexity of 17 (exceeds 5 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']
- 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_pvalues
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def aai_pvalues(aai, test, opts = {})
y = {}
Zlib::GzipReader.open(aai_path(test, opts)) do |fh|
keys = nil
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 download_datasets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def download_datasets
# Download datasets from NCBI
unless cli[:ncbi_taxon].nil?
what = cli[:ncbi_ref] ? '--reference' :
cli[:ncbi_draft] ? '--all' : '--complete'
- 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 Result
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class MiGA::Result < MiGA::MiGA
include MiGA::Result::Dates
include MiGA::Result::Source
include MiGA::Result::Stats
include MiGA::Result::Versions
- Create a ticketCreate a ticket
Method parse_cli
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.interactive = true
cli.defaults = {
mytaxa: nil,
rdp: nil,
- Create a ticketCreate a ticket
Method check_datasets
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def check_datasets
l_say(2, 'Checking datasets')
o = false
project.each_dataset do |ds|
next unless ds.status == :incomplete
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cli
cli.defaults = {
database: :recommended,
version: :latest,
local: File.join(ENV['MIGA_HOME'], '.miga_db'),
- Create a ticketCreate a ticket
Method seqs_length
has 50 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method test_add_result_other
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_add_result_other
d2 = project.add_dataset('ds_add_result_other')
Dir.mkdir(
File.join(
project.path, 'data', '07.annotation', '01.function', '01.essential',
- Create a ticketCreate a ticket