bio-miga/miga

View on GitHub

Showing 1,600 of 1,614 total issues

Assignment Branch Condition size for test_preprocessing is too high. [26.31/15]
Open

  def test_preprocessing
    p1 = project
    assert_predicate(p1, :done_preprocessing?)
    d1 = p1.add_dataset('BAH')
    assert_not_predicate(p1, :done_preprocessing?)
Severity: Minor
Found in test/project_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_aai_taxtest is too high. [26.31/15]
Open

  def test_aai_taxtest
    distant_intax = MiGA::TaxDist.aai_taxtest(35.0, :intax, engine: :diamond)
    assert_equal(:root, distant_intax[:most_likely][0])
    assert_equal(:d, distant_intax[:probably][0])
    assert_nil(distant_intax[:possibly_even])
Severity: Minor
Found in test/tax_dist_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. [21/10]
Open

  def test_generic_transfer
    hello = File.expand_path('Hello', tmpdir)
    world = File.expand_path('World', tmpdir)
    assert_respond_to(File, :generic_transfer)
    FileUtils.touch(hello)
Severity: Minor
Found in test/common_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. [21/10]
Open

  def test_dataset_result_hooks
    $res = :test
    $counter = 1
    dataset.add_hook(:on_result_ready, :run_lambda, Proc.new { |r| $res = r })
    dataset.add_hook(
Severity: Minor
Found in test/hook_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. [21/10]
Open

  def compute_stats_cds
    s = MiGA::MiGA.seqs_length(file_path(:proteins), :fasta)
    stats = {
      predicted_proteins: s[:n],
      average_length: [s[:avg], 'aa']
Severity: Minor
Found in lib/miga/result/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.

Cyclomatic complexity for advance is too high. [17/6]
Open

  def advance(step, n = 0, total = nil, bin = true)
    # Initialize advance timing
    @_advance_time ||= { last: nil, n: 0, avg: nil, total: total }
    if @_advance_time[:n] > n || total != @_advance_time[:total]
      @_advance_time[:last] = nil
Severity: Minor
Found in lib/miga/common.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 run_cmd is too high. [18/7]
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]
Severity: Minor
Found in lib/miga/common/system_call.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

Assignment Branch Condition size for save_bidirectional is too high. [26.94/15]
Open

  def save_bidirectional(a, dist)
    each_database_file(a) do |db_file, metric, result, rank|
      next if rank == :haai # No need for hAAI to be bidirectional
      next if result == :taxonomy # Taxonomy is never bidirectional

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

  def generate_summary_page(path, p)
    b = File.basename(path, '.tsv')
    table = '<table class="table table-hover table-responsive">'
    File.open(path, 'r') do |fh|
      fh.each do |ln|
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 configure_slurm_daemon is too high. [26.93/15]
Open

  def configure_slurm_daemon(v)
    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
    v[:maxjobs] = cli.ask_user('How many jobs can I launch at once?', '300').to_i
    v[:ppn]     = cli.ask_user('How many CPUs can I use per job?', '2').to_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. [21/10]
Open

  def format_results(obj)
    o = ''
    obj.each_result do |key, res|
      links = format_result_links(res)
      stats = format_result_stats(res)
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. [26.27/15]
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 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_configuration_script is too high. [26.25/15]
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 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_digest is too high. [26.98/15]
Open

  def check_digest(ver, file)
    cli.say 'Checking MD5 digest'
    cli.say "Expected: #{ver[:MD5]}"
    md5 = Digest::MD5.new
    size = File.size(file)
Severity: Minor
Found in lib/miga/cli/action/db.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. [21/10]
Open

  def opts_for_wf_distances(opt)
    opt.on('--sensitive', 'Alias to: --aai-p blast+ --ani-p blast+') do
      cli[:aai_p] = 'blast+'
      cli[:ani_p] = 'blast+'
    end
Severity: Minor
Found in lib/miga/cli/action/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.

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

  def parse_cli
    cli.defaults = {
      query: false, unlink: false,
      reference: false, add_version: true, dry: false,
      get_md: false, only_md: false, save_every: 1
Severity: Minor
Found in lib/miga/cli/action/seqcode_get.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. [21/10]
Open

  def parse_cli
    cli.defaults = { info: false, force: false, method: :hardlink }
    cli.parse do |opt|
      cli.opt_object(opt, [:project, :dataset_opt])
      opt.on(
Severity: Minor
Found in lib/miga/cli/action/ln.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. [21/10]
Open

  def perform
    # Input data
    ref_db = reference_db
    norun = %w[
      haai_distances aai_distances ani_distances clade_finding
Severity: Minor
Found in lib/miga/cli/action/classify_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.

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

  def parse_cli
    cli.defaults = { info: false, processing: false, silent: false }
    cli.parse do |opt|
      cli.opt_object(opt, [:project, :dataset_opt])
      cli.opt_filter_datasets(opt)
Severity: Minor
Found in lib/miga/cli/action/ls.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. [21/10]
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 if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Severity
Category
Status
Source
Language