dpn-admin/dpn-bagit

View on GitHub

Showing 27 of 27 total issues

Useless public access modifier.
Open

  public
Severity: Minor
Found in lib/dpn/bagit/settings.rb by rubocop

This cop checks for redundant access modifiers, including those with no code, those which are repeated, and leading public modifiers in a class or module body. Conditionally-defined methods are considered as always being defined, and thus access modifiers guarding such methods are not redundant.

Example:

class Foo
  public # this is redundant (default access is public)

  def method
  end

  private # this is not redundant (a method is defined)
  def method2
  end

  private # this is redundant (no following methods are defined)
end

Example:

class Foo
  # The following is not redundant (conditionally defined methods are
  # considered as always defining a method)
  private

  if condition?
    def method
    end
  end

  protected # this is not redundant (method is defined)

  define_method(:method2) do
  end

  protected # this is redundant (repeated from previous modifier)

  [1,2,3].each do |i|
    define_method("foo#{i}") do
    end
  end

  # The following is redundant (methods defined on the class'
  # singleton class are not affected by the public modifier)
  public

  def self.method3
  end
end

Example:

# Lint/UselessAccessModifier:
#   ContextCreatingMethods:
#     - concerning
require 'active_support/concern'
class Foo
  concerning :Bar do
    def some_public_method
    end

    private

    def some_private_method
    end
  end

  # this is not redundant because `concerning` created its own context
  private

  def some_other_private_method
  end
end

Example:

# Lint/UselessAccessModifier:
#   MethodCreatingMethods:
#     - delegate
require 'active_support/core_ext/module/delegation'
class Foo
  # this is not redundant because `delegate` creates methods
  private

  delegate :method_a, to: :method_b
end

Do not use prefix _ for a variable that is used.
Open

      def initialize(_location)
Severity: Minor
Found in lib/dpn/bagit/bag.rb by rubocop

This cop checks for underscore-prefixed variables that are actually used.

Example:

# bad

[1, 2, 3].each do |_num|
  do_something(_num)
end

Example:

# good

[1, 2, 3].each do |num|
  do_something(num)
end

Example:

# good

[1, 2, 3].each do |_num|
  do_something # not using `_num`
end

File.exists? is deprecated in favor of File.exist?.
Open

            if File.exists?(path)
Severity: Minor
Found in lib/dpn/bagit/bag.rb by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

File.exists? is deprecated in favor of File.exist?.
Open

        if File.exists?(@bag.tagmanifest_file("sha256")) == true
Severity: Minor
Found in lib/dpn/bagit/bag.rb by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

end at 25, 4 is not aligned with def at 12, 6.
Open

    end
Severity: Minor
Found in lib/dpn/bagit/bag.rb by rubocop

This cop checks whether the end keywords of method definitions are aligned properly.

Two modes are supported through the EnforcedStyleAlignWith configuration parameter. If it's set to start_of_line (which is the default), the end shall be aligned with the start of the line where the def keyword is. If it's set to def, the end shall be aligned with the def keyword.

Example: EnforcedStyleAlignWith: startofline (default)

# bad

private def foo
            end

# good

private def foo
end

Example: EnforcedStyleAlignWith: def

# bad

private def foo
            end

# good

private def foo
        end

File.exists? is deprecated in favor of File.exist?.
Open

        if File.exists?(@bag.fetch_txt_file) == true
Severity: Minor
Found in lib/dpn/bagit/bag.rb by rubocop

This cop checks for uses of the deprecated class method usages.

Example:

# bad

File.exists?(some_path)

Example:

# good

File.exist?(some_path)

TODO found
Open

  # spec.homepage      = "TODO: Put your gem's website or public repo URL here."
Severity: Minor
Found in dpn-bagit.gemspec by fixme
Severity
Category
Status
Source
Language