bio-miga/miga

View on GitHub

Showing 1,596 of 1,610 total issues

Assignment Branch Condition size for perform is too high. [28.3/15]
Open

  def perform
    cli.ensure_par(tarball: '-o')
    unless cli[:tarball] =~ /\.tar\.gz$/
      raise 'The tarball path (-o) must have .tar.gz extension'
    end
Severity: Minor
Found in lib/miga/cli/action/archive.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [23/10]
Open

  def each_database_file(dataset, &blk)
    ref_db = {
      haai: ['01.haai', :aai], aai: ['02.aai', :aai], ani: ['03.ani', :ani]
    }
    qry_db = {

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for run_daemon is too high. [28.6/15]
Open

  def run_daemon
    return if cli[:prepare_and_exit]

    cmd  = ['daemon', 'run', '-P', cli[:outdir], '--shutdown-when-done']
    cmd += ['--json', cli[:daemon_json]] if cli[:daemon_json]
Severity: Minor
Found in lib/miga/cli/action/wf.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for parse_cli is too high. [28.07/15]
Open

  def parse_cli
    cli.opt_common = false
    cli.parse do |opt|
      descriptions = cli.class.TASK_DESC.keep_if { |k, v| k != :generic }
      opt.separator MiGA::MiGA.tabulate(
Severity: Minor
Found in lib/miga/cli/action/generic.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

File remote_dataset.rb has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'miga/taxonomy'
require 'miga/remote_dataset/download'

##
# MiGA representation of datasets with data in remote locations.
Severity: Minor
Found in lib/miga/remote_dataset.rb - About 3 hrs to fix

Method has too many lines. [22/10]
Open

  def test_seqs_length_fasta
    c = ">a\nACA\n>b\nACG\n>c\nACTGA\n>d\nGTGAG\n"
    f = helper_write_file(c)
    o = MiGA::MiGA.seqs_length(f, :fasta)
    assert_equal(4.0, o[:avg])
Severity: Minor
Found in test/format_test.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

  def test_alternative
    tx = MiGA::Taxonomy.new('ns:a s:Arnie', nil,
                            ['ns:b s:Bernie', 'ns:c s:Cornie', 's:Darnie'])
    # Fields
    assert_equal('ns:a s:Arnie', tx.to_s)
Severity: Minor
Found in test/taxonomy_test.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

    def aai_pvalues(aai, test, opts = {})
      y = {}
      Zlib::GzipReader.open(aai_path(test, opts)) do |fh|
        keys = nil
        fh.each_line do |ln|
Severity: Minor
Found in lib/miga/tax_dist.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Confirmed

  def save_to(project, name = nil, is_ref = true, metadata_def = {})
    name ||= ids.join('_').miga_name
    project = MiGA::Project.new(project) if project.is_a? String
    MiGA::Dataset.exist?(project, name) and
      raise "Dataset #{name} exists in the project, aborting..."
Severity: Minor
Found in lib/miga/remote_dataset.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

  def flush!
    # Check for finished jobs
    l_say(2, 'Checking for finished jobs')
    @jobs_running.select! do |job|
      ongoing =
Severity: Minor
Found in lib/miga/daemon.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
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,
Severity: Minor
Found in lib/miga/daemon/base.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

  def add_result_clade_finding(base, _opts)
    if result_files_exist?(base, %w[.empty])
      r = MiGA::Result.new("#{base}.json")
      r.add_file(:empty, 'miga-project.empty')
      return r
Severity: Minor
Found in lib/miga/project/result.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

  def cli_filters(opt)
    opt.on(
      '--exclude PATH',
      'A file with dataset names to exclude'
    ) { |v| cli[:exclude] = v }

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for perform is too high. [27.37/15]
Open

  def perform
    cli.ensure_par(path: '-p')
    k_opts = %i[
      json latency wait_for keep_inactive trust_timestamp name dry exclude
    ]
Severity: Minor
Found in lib/miga/cli/action/lair.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for configure_daemon is too high. [27.66/15]
Open

  def configure_daemon
    cli.puts 'Default daemon configuration:'
    daemon_f = File.expand_path('.miga_daemon.json', ENV['MIGA_HOME'])
    unless File.exist?(daemon_f) and cli.ask_user(
      'A template daemon already exists, do you want to preserve it?',

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for check_db is too high. [27.95/15]
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|

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [22/10]
Open

  def parse_cli
    cli.defaults = { add: false, ref: true }
    cli.parse do |opt|
      cli.opt_object(opt, [:project, :dataset_type])
      opt.on(
Severity: Minor
Found in lib/miga/cli/action/find.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/10]
Open

  def perform
    # Quick check when the database is not an alias
    dir = File.join(cli[:local], cli[:database].to_s)
    if !cli[:overwrite] && Dir.exist?(dir)
      cli.puts "Database exists: #{dir}"
Severity: Minor
Found in lib/miga/cli/action/db.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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
Severity: Major
Found in lib/miga/cli/action/init/daemon_helper.rb - About 2 hrs to fix

Assignment Branch Condition size for test_taxonomy is too high. [26.08/15]
Open

  def test_taxonomy
    # Prepare result
    dir = 'data/09.distances/05.taxonomy'
    FileUtils.touch(file_path(dir, '.aai-medoids.tsv'))
    FileUtils.touch(file_path(dir, '.aai.db'))
Severity: Minor
Found in test/result_stats_test.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Severity
Category
Status
Source
Language