ifad/vacman_controller

View on GitHub
lib/vacman_controller/kernel.rb

Summary

Maintainability
A
0 mins
Test Coverage

Line is too long. [84/80]
Open

        @_property_names ||= VacmanController::LowLevel.kernel_property_names.freeze
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

Extra blank line detected.
Open


      # Gets the available kernel property names
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Extra blank line detected.
Open


      # Get a Kernel property, that is a runtime parameter of Vacman Controller,
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Redundant self detected.
Open

        "#<#{self.name} version=#{version['version'].inspect} bitness=#{version['bitness'].inspect} "\
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks for redundant uses of self.

The usage of self is only needed when:

  • Sending a message to same object with zero arguments in presence of a method name clash with an argument or a local variable.

  • Calling an attribute writer to prevent an local variable assignment.

Note, with using explicit self you can only send messages with public or protected scope, you cannot send private messages this way.

Note we allow uses of self with operators because it would be awkward otherwise.

Example:

# bad
def foo(bar)
  self.baz
end

# good
def foo(bar)
  self.bar  # Resolves name clash with the argument.
end

def foo
  bar = 1
  self.bar  # Resolves name clash with the local variable.
end

def foo
  %w[x y z].select do |bar|
    self.bar == bar  # Resolves name clash with argument of the block.
  end
end

Prefer $ERROR_INFO from the stdlib 'English' module (don't forget to require it) over $!.
Open

          h.update(name => (self[name] rescue "ERROR: #$!"))
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

Extra empty line detected at module body end.
Open


end
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks if empty lines around the bodies of modules match the configuration.

Example: EnforcedStyle: empty_lines

# good

module Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

module Foo
  module Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
module Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

module Foo
  def bar
    # ...
  end
end

Use empty lines between method definitions.
Open

      def property_names
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Extra blank line detected.
Open


      # Shows the kernel version, bitness, type and parameters in your
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use empty lines between method definitions.
Open

      def all
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Line is too long. [102/80]
Open

        "#<#{self.name} version=#{version['version'].inspect} bitness=#{version['bitness'].inspect} "\
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

Missing top-level module documentation comment.
Open

  module Kernel
Severity: Minor
Found in lib/vacman_controller/kernel.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

Extra empty line detected at module body beginning.
Open


  module Kernel
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks if empty lines around the bodies of modules match the configuration.

Example: EnforcedStyle: empty_lines

# good

module Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

module Foo
  module Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
module Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

module Foo
  def bar
    # ...
  end
end

Replace interpolated variable $! with expression #{$!}.
Open

          h.update(name => (self[name] rescue "ERROR: #$!"))
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks for variable interpolation (like "#@ivar").

Example:

# bad
"His name is #$name"
/check #$pattern/
"Let's go to the #@store"

# good
"His name is #{$name}"
/check #{$pattern}/
"Let's go to the #{@store}"

Extra blank line detected.
Open


      # Returns all configured parameters
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Extra blank line detected.
Open


      # Set a Kernel property.
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Avoid using rescue in its modifier form.
Open

          h.update(name => (self[name] rescue "ERROR: #$!"))
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks for uses of rescue in its modifier form.

Example:

# bad
some_method rescue handle_error

# good
begin
  some_method
rescue
  handle_error
end

Use empty lines between method definitions.
Open

      def inspect
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

Use empty lines between method definitions.
Open

      def []=(name, val)
Severity: Minor
Found in lib/vacman_controller/kernel.rb by rubocop

This cop checks whether method definitions are separated by one empty line.

NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

Example:

# bad
def a
end
def b
end

Example:

# good
def a
end

def b
end

There are no issues that match your filters.

Category
Status