bio-miga/miga

View on GitHub

Showing 1,637 of 1,651 total issues

Use snake_case for variable names.
Open

  @@PREPROCESSING_TASKS = %i[
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for method names.
Open

    def INFO_FIELDS
Severity: Minor
Found in lib/miga/dataset.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Missing magic comment # frozen_string_literal: true.
Open

require 'miga/remote_dataset/base'
Severity: Minor
Found in lib/miga/remote_dataset/download.rb by rubocop

This cop is designed to help upgrade to Ruby 3.0. It will add the comment # frozen_string_literal: true to the top of files to enable frozen string literals. Frozen string literals may be default in Ruby 3.0. The comment will be added below a shebang and encoding comment. The frozen string literal comment is only valid in Ruby 2.3+.

Example: EnforcedStyle: when_needed (default)

# The `when_needed` style will add the frozen string literal comment
# to files only when the `TargetRubyVersion` is set to 2.3+.
# bad
module Foo
  # ...
end

# good
# frozen_string_literal: true

module Foo
  # ...
end

Example: EnforcedStyle: always

# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
  # ...
end

# good
# frozen_string_literal: true

module Bar
  # ...
end

Example: EnforcedStyle: never

# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true

module Baz
  # ...
end

# good
module Baz
  # ...
end

Use snake_case for variable names.
Open

  @@UNIVERSE = {
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

  @@EXCLUDE_NOREF_TASKS = %i[mytaxa_scan taxonomy]
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Missing top-level class documentation comment.
Open

class MiGA::Dataset < MiGA::MiGA
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Indent the first line of the right-hand-side of a multi-line assignment.
Open

      {
        universe: universe,  db:   db,    ids: ids.is_a?(Array) ? ids : [ids],
        format:   format,    file: file,  obj: obj,
        extra:    (database_hash[:extra] || {}).merge(extra),
        _fun:     :"#{getter}_#{action}"
Severity: Minor
Found in lib/miga/remote_dataset/download.rb by rubocop

This cop checks the indentation of the first line of the right-hand-side of a multi-line assignment.

Example:

# bad
value =
if foo
  'bar'
end

# good
value =
  if foo
    'bar'
  end

The indentation of the remaining lines can be corrected with other cops such as IndentationConsistency and EndAlignment.

Trailing whitespace detected.
Open

      ids = 
Severity: Minor
Found in lib/miga/remote_dataset/download.rb by rubocop

Replace class var @@UNIVERSE with a class instance var.
Open

  @@UNIVERSE = {
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

Use ./*glob* or -- *glob* so names with dashes won't become options.
Open

      && tar -zcf proteins.tar.gz *.faa \
Severity: Minor
Found in scripts/essential_genes.bash by shellcheck

Use ./*glob* or -- *glob* so names with dashes won't become options.

Problematic code:

rm *

Correct code:

rm ./*

or

rm -- *

Rationale

Since files and arguments are strings passed the same way, programs can't properly determine which is which, and rely on dashes to determine what's what.

A file named -f (touch -- -f) will not be deleted by the problematic code. It will instead be interpreted as a command line option, and rm will even report success.

Using ./* will instead cause the glob to be expanded into ./-f, which no program will treat as an option.

Similarly, -- by convention indicates the end of options, and nothing after it will be treated like flags (except for some programs possibly still special casing - as e.g. stdin).

Note that changing * to ./* in GNU Tar parameters will add ./ prefix to path names in the created archive. This may cause subtle problems (eg. to search for a specific file in archive, the ./ prefix must be specified as well). So using -- * is a safer fix for GNU Tar commands.

For more information, see "Filenames and Pathnames in Shell: How to do it Correctly".

Notice

Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.

Provide an exception class and message as arguments to raise.
Open

      raise MiGA::Error.new("Unknown dataset type: #{type}")
Severity: Minor
Found in lib/miga/dataset/type.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Provide an exception class and message as arguments to raise.
Open

      raise MiGA::Error.new(
        "Dataset type (#{type}) incompatible with project (#{project.type})"
      )
Severity: Minor
Found in lib/miga/dataset/type.rb by rubocop

This cop checks the args passed to fail and raise. For exploded style (default), it recommends passing the exception class and message to raise, rather than construct an instance of the error. It will still allow passing just a message, or the construction of an error with more than one argument.

The exploded style works identically, but with the addition that it will also suggest constructing error objects when the exception is passed multiple arguments.

Example: EnforcedStyle: exploded (default)

# bad
raise StandardError.new("message")

# good
raise StandardError, "message"
fail "message"
raise MyCustomError.new(arg1, arg2, arg3)
raise MyKwArgError.new(key1: val1, key2: val2)

Example: EnforcedStyle: compact

# bad
raise StandardError, "message"
raise RuntimeError, arg1, arg2, arg3

# good
raise StandardError.new("message")
raise MyCustomError.new(arg1, arg2, arg3)
fail "message"

Add parentheses to nested method call spawn hook_args.first.miga_variables( dataset: name, project: project.path, project_name: project.name, miga: MiGA::MiGA.root_path, object: event_args.first ).
Open

      spawn hook_args.first.miga_variables(
        dataset: name, project: project.path, project_name: project.name,
        miga: MiGA::MiGA.root_path, object: event_args.first
      )
Severity: Minor
Found in lib/miga/dataset/hooks.rb by rubocop

This cop checks for unparenthesized method calls in the argument list of a parenthesized method call.

Example:

# good
method1(method2(arg), method3(arg))

# bad
method1(method2 arg, method3, arg)

Use snake_case for variable names.
Open

  @@KNOWN_TYPES = {
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Replace class var @@_EXCLUDE_NOREF_TASKS_H with a class instance var.
Open

  @@_EXCLUDE_NOREF_TASKS_H = Hash[@@EXCLUDE_NOREF_TASKS.map { |i| [i, true] }]
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

Replace class var @@_EXCLUDE_NOMARKER_TASKS_H with a class instance var.
Open

  @@_EXCLUDE_NOMARKER_TASKS_H =
Severity: Minor
Found in lib/miga/dataset/base.rb by rubocop

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

Use snake_case for method names.
Open

    def UNIVERSE
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Use snake_case for variable names.
Open

  @@_EUTILS        = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/'
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

  @@_GTDB_API      = 'https://gtdb-api.ecogenomic.org/'
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

  @@_SEQCODE_API   = 'https://api.seqco.de/v1/'
Severity: Minor
Found in lib/miga/remote_dataset/base.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1
Severity
Category
Status
Source
Language