bio-miga/miga

View on GitHub

Showing 839 of 1,651 total issues

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

  def check_configuration_script(rc_fh)
    unless File.exist? cli[:config]
      cli[:config] = cli.ask_user(
        'Is there a script I need to load at startup?',
        cli[:config]

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. [15/10]
Open

  def perform
    r = cli.load_result or return

    cli[:compute] = false if cli[:try_load] && !r[:stats]&.empty?

Severity: Minor
Found in lib/miga/cli/action/stats.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. [15/10]
Open

  def perform
    cli.puts <<~BANNER
      ===[ Welcome to MiGA, the Microbial Genome Atlas ]===

      I'm the initialization script, and I'll sniff around your computer to
Severity: Minor
Found in lib/miga/cli/action/init.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. [15/10]
Open

  def test_library(cli, paths, language, pkg)
    opts = { raise: false, return: :status, stderr: '/dev/null' }
    status =
      case language
      when :r
Severity: Minor
Found in lib/miga/cli/action/init.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. [15/10]
Open

  def perform
    p = cli.load_project
    cli.ensure_par(type: '-t')
    files, file_type = get_files_and_type

Severity: Minor
Found in lib/miga/cli/action/add.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. [15/10]
Open

  def perform
    p = cli.load_project
    if not cli[:datum].nil?
      v = p.metadata[cli[:datum]]
      cli.puts v.nil? ? '?' : v
Severity: Minor
Found in lib/miga/cli/action/about.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.

Cyclomatic complexity for perform is too high. [11/6]
Open

  def perform
    cli.ensure_par(result: '-r')
    ds = cli.load_and_filter_datasets
    cli.say 'Loading results'
    k = 0
Severity: Minor
Found in lib/miga/cli/action/summary.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

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

  def ignore_by_type?(task, type)
    return false if force_task?(task)

    test, list =
      case type.to_sym
Severity: Minor
Found in lib/miga/dataset/result/ignore.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. [15/10]
Open

  def initialize(project, name, is_ref = true, metadata = {})
    name = name.to_s
    name.miga_name? or
      raise 'Invalid name, please use only alphanumerics and underscores: ' +
            name
Severity: Minor
Found in lib/miga/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.

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
Severity: Minor
Found in lib/miga/result.rb - About 2 hrs to fix

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

Assignment Branch Condition size for test_assembly is too high. [19.24/15]
Open

  def test_assembly
    # Prepare result
    dir = 'data/05.assembly'
    fa = file_path(dir, '.LargeContigs.fna')
    File.open(fa, 'w') { |fh| fh.puts('>1', 'ACTAC' * 500) }
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

Assignment Branch Condition size for test_gtdb_taxonomy is too high. [19.1/15]
Open

  def test_gtdb_taxonomy
    declare_remote_access
    rd = MiGA::RemoteDataset.new('GCA_018200315.1', :assembly, :gtdb)
    md = rd.get_metadata
    assert(!md[:is_type])
Severity: Minor
Found in test/remote_dataset_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

Assignment Branch Condition size for test_initialize is too high. [19/15]
Open

  def test_initialize
    assert_raise { MiGA::Dataset.new(project, 'dataset-1') }
    assert_equal(project, dataset.project)
    assert_equal('dataset0', dataset.name)
    assert_predicate(dataset, :ref?)
Severity: Minor
Found in test/dataset_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

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

  def test_verbosity
    d1 = daemon
    d1.runopts(:verbosity, 0)
    out = capture_stderr { d1.in_loop }.string
    assert_empty(out)
Severity: Minor
Found in test/daemon_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.

Assignment Branch Condition size for test_assess_success is too high. [19.26/15]
Open

  def test_assess_success
    declare_forks

    o = MiGA::Parallel.process(1) { |i| i / 2 }
    assert(o.all? { |i| i[1].success? })
Severity: Minor
Found in test/parallel_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

Assignment Branch Condition size for test_distribute is too high. [19.1/15]
Open

  def test_distribute
    declare_forks

    base = tmpfile('base')
    assert(!File.exist?("#{base}-3"))
Severity: Minor
Found in test/parallel_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

Assignment Branch Condition size for ask_user is too high. [19.21/15]
Open

  def ask_user(question, default = nil, answers = nil, force = false)
    ans = " (#{answers.join(' / ')})" unless answers.nil?
    dft = " [#{default}]" unless default.nil?
    print "#{question}#{ans}#{dft} > "
    if self[:auto] && !force
Severity: Minor
Found in lib/miga/cli.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 get_metadata is too high. [19.31/15]
Open

  def get_metadata(metadata_def = {})
    metadata_def.each { |k, v| @metadata[k] = v }
    return @metadata if @metadata[:bypass_metadata]

    case universe
Severity: Minor
Found in lib/miga/remote_dataset.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 save_assembly_to is too high. [19.75/15]
Open

  def save_assembly_to(project, name, udb)
    dir = MiGA::Dataset.RESULT_DIRS[:assembly]
    base = "#{project.path}/data/#{dir}/#{name}"
    l_ctg = "#{base}.LargeContigs.fna"
    a_ctg = "#{base}.AllContigs.fna"
Severity: Minor
Found in lib/miga/remote_dataset.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