bio-miga/miga

View on GitHub

Showing 1,637 of 1,651 total issues

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

  def http_request(method, url, *opts)
    doc = nil
    remote_connection(url).start do |http|
      res = http.send(method, remote_connection_uri.to_s, *opts)
      if %w[301 302].include?(res.code)
Severity: Minor
Found in lib/miga/common/net.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. [11/10]
Open

  def perform
    dist = read_distances
    Dir.mktmpdir do |dir|
      tab = get_tab_index(dir)
      dist = traverse_taxonomy(tab, dist)
Severity: Minor
Found in lib/miga/cli/action/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.

Assignment Branch Condition size for parse_reports_as_datasets is too high. [16.16/15]
Open

  def parse_reports_as_datasets(reports)
    ds = {}
    reports.each do |r|
      asm = r[:accession]
      next if asm.nil? || asm.empty? || asm == '-'

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

  def run_cmd_opts(opts = {})
    {
      stdout: nil,
      stderr: nil,
      dry: false,
Severity: Minor
Found in lib/miga/common/system_call.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.

Perceived complexity for assert_valid_option_value is too high. [8/7]
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
Severity: Minor
Found in lib/miga/common/with_option.rb by rubocop

This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

Cyclomatic complexity for read_distances is too high. [7/6]
Open

  def read_distances
    p = cli.load_project
    cli[:metric] ||= p.clade? ? 'ani' : 'aai'
    res_n = "#{cli[:metric]}_distances"
    cli.say "Reading distances: 1-#{cli[:metric].upcase}"
Severity: Minor
Found in lib/miga/cli/action/tax_dist.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.

Perceived complexity for configure_qsub_msub_daemon is too high. [8/7]
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

This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

Cyclomatic complexity for check_mts is too high. [7/6]
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?

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.

Cyclomatic complexity for opts_for_wf is too high. [7/6]
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(
Severity: Minor
Found in lib/miga/cli/action/wf.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. [11/10]
Open

  def perform
    # Input data
    p = create_project(
      :assembly,
      { run_clades: false },
Severity: Minor
Found in lib/miga/cli/action/derep_wf.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.

Perceived complexity for run_daemon is too high. [8/7]
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 tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

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

  def generate_datasets_index(p)
    cli.say 'Creating index pages'
    data = format_dataset_index(p)
    data.each do |k, v|
      write_file(p, "#{k}_datasets.html") do
Severity: Minor
Found in lib/miga/cli/action/browse.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 perform is too high. [16.06/15]
Open

  def perform
    # Input data
    p = create_project(
      :assembly,
      { run_clades: false },
Severity: Minor
Found in lib/miga/cli/action/derep_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 perform is too high. [16.4/15]
Open

  def perform
    p = cli.load_project
    q = cli.load_project(:project2, '-Q')
    ds = cli.load_and_filter_datasets
    ds.each do |d|
Severity: Minor
Found in lib/miga/cli/action/ln.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. [11/10]
Open

  def list_requirements
    if cli.ask_user(
      'Would you like to see all the requirements before starting?',
      'no', %w(yes no)
    ) == 'yes'
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. [11/10]
Open

  def check_and_install_library(paths, language, library)
    cli.print "Testing #{library}... "
    if test_library(cli, paths, language, library)
      cli.puts 'yes'
    else
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. [11/10]
Open

  def download_file(ftp, path, reuse = false)
    cli.say "Downloading '#{path}'"
    file = File.expand_path(path, cli[:local])
    if reuse && File.exist?(file)
      cli.say "Reusing #{file}"
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.

Cyclomatic complexity for get_sub_cli is too high. [7/6]
Open

  def get_sub_cli
    return [cli] if cli[:file].nil? || cli[:ignore_file]

    glob = []
    cli_default = cli.original_argv + ['--ignore-file']
Severity: Minor
Found in lib/miga/cli/action/get.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.

Cyclomatic complexity for perform is too high. [7/6]
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 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.

Cyclomatic complexity for reference_db is too high. [7/6]
Open

  def reference_db
    cli.say "Locating reference database"
    ref_db_path = cli[:db_path]
    if ref_db_path.nil?
      if cli[:download]
Severity: Minor
Found in lib/miga/cli/action/classify_wf.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.

Severity
Category
Status
Source
Language