etehtsea/oxblood

View on GitHub
lib/redis/connection/oxblood.rb

Summary

Maintainability
A
0 mins
Test Coverage

Missing top-level class documentation comment.
Open

    class Oxblood
Severity: Minor
Found in lib/redis/connection/oxblood.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

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

        raise Redis::ProtocolError.new(e.message)
Severity: Minor
Found in lib/redis/connection/oxblood.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"

Line is too long. [91/80]
Open

        reply = CommandError.new(reply.message) if reply.is_a?(::Oxblood::Protocol::RError)
Severity: Minor
Found in lib/redis/connection/oxblood.rb by rubocop

Do not use :: for method calls.
Open

      if defined?(Encoding::default_external)
Severity: Minor
Found in lib/redis/connection/oxblood.rb by rubocop

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Do not use :: for method calls.
Open

          string.force_encoding(Encoding::default_external)
Severity: Minor
Found in lib/redis/connection/oxblood.rb by rubocop

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

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

        raise Redis::TimeoutError.new(e.message)
Severity: Minor
Found in lib/redis/connection/oxblood.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"

There are no issues that match your filters.

Category
Status