etehtsea/oxblood

View on GitHub

Showing 130 of 130 total issues

Line is too long. [83/80]
Open

      # Remove all members in a sorted set between the given lexicographical range.
Severity: Minor
Found in lib/oxblood/commands/sorted_sets.rb by rubocop

Line is too long. [81/80]
Open

      #   sorted set score of the item, in the form of a 52 bit unsigned integer.
Severity: Minor
Found in lib/oxblood/commands/geo.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        if storedist_key = opts[:storedist]
Severity: Minor
Found in lib/oxblood/commands/geo.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
Open

        if v = opts[:weights]
Severity: Minor
Found in lib/oxblood/commands/sorted_sets.rb by rubocop

This cop checks for assignments in the conditions of if/while/until.

Example:

# bad

if some_var = true
  do_something
end

Example:

# good

if some_var == true
  do_something
end

Line is too long. [82/80]
Open

      # Add one or more members to a sorted set, or update its score if it already
Severity: Minor
Found in lib/oxblood/commands/sorted_sets.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        if v = opts[:match]
Severity: Minor
Found in lib/oxblood/commands/scan.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Line is too long. [81/80]
Open

      #   returns an array of elements, or an empty array when key does not exist
Severity: Minor
Found in lib/oxblood/commands/sets.rb by rubocop

Line is too long. [88/80]
Open

    # @note Will raise RSocket::TimeoutError even if there is simply no response to read
Severity: Minor
Found in lib/oxblood/connection.rb by rubocop

Literal true appeared as a condition.
Open

      end while true
Severity: Minor
Found in lib/oxblood/rsocket.rb by rubocop

This cop checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until.

Example:

# bad

if 20
  do_something
end

Example:

# bad

if some_var && true
  do_something
end

Example:

# good

if some_var && some_condition
  do_something
end

Do not use semicolons to terminate expressions.
Open

      ;
Severity: Minor
Found in lib/oxblood/rsocket.rb by rubocop

This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.

Example:

# bad
foo = 1; bar = 2;
baz = 3;

# good
foo = 1
bar = 2
baz = 3

Missing top-level module documentation comment.
Open

    module Strings
Severity: Minor
Found in lib/oxblood/commands/strings.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

Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
Open

          if v = opts_or_addr[:type]
Severity: Minor
Found in lib/oxblood/commands/server.rb by rubocop

This cop checks for assignments in the conditions of if/while/until.

Example:

# bad

if some_var = true
  do_something
end

Example:

# good

if some_var == true
  do_something
end

Line is too long. [84/80]
Open

      # Return a range of members in a sorted set, by lexicographical range, ordered
Severity: Minor
Found in lib/oxblood/commands/sorted_sets.rb by rubocop

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

Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency pry should appear before rspec.
Open

  spec.add_development_dependency 'pry'
Severity: Minor
Found in oxblood.gemspec by rubocop

Dependencies in the gemspec should be alphabetically sorted.

Example:

# bad
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'

# good
spec.add_dependency 'rspec'
spec.add_dependency 'rubocop'

# good
spec.add_dependency 'rubocop'

spec.add_dependency 'rspec'

# bad
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'

# good
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'

# good
spec.add_development_dependency 'rubocop'

spec.add_development_dependency 'rspec'

# bad
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'

# good
spec.add_runtime_dependency 'rspec'
spec.add_runtime_dependency 'rubocop'

# good
spec.add_runtime_dependency 'rubocop'

spec.add_runtime_dependency 'rspec'

# good only if TreatCommentsAsGroupSeparators is true
# For code quality
spec.add_dependency 'rubocop'
# For tests
spec.add_dependency 'rspec'

Line is too long. [84/80]
Open

    # @option opts [String] :host ('localhost') Hostname or IP address to connect to
Severity: Minor
Found in lib/oxblood/connection.rb by rubocop

Missing top-level module documentation comment.
Open

  module Commands
Severity: Minor
Found in lib/oxblood/commands.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

Do not suppress exceptions.
Open

    rescue IOError
Severity: Minor
Found in lib/oxblood/rsocket.rb by rubocop

This cop checks for rescue blocks with no body.

Example:

# bad

def some_method
  do_something
rescue
  # do nothing
end

Example:

# bad

begin
  do_something
rescue
  # do nothing
end

Example:

# good

def some_method
  do_something
rescue
  handle_exception
end

Example:

# good

begin
  do_something
rescue
  handle_exception
end

Line is too long. [84/80]
Open

                       Gem::Version.new(JRUBY_VERSION) < Gem::Version.new('9.1.6.0')
Severity: Minor
Found in lib/oxblood/rsocket.rb by rubocop

Avoid the use of the case equality operator ===.
Open

          if Array === c
Severity: Minor
Found in lib/oxblood/protocol.rb by rubocop

This cop checks for uses of the case equality operator(===).

Example:

# bad
Array === something
(1..100) === 7
/something/ === some_string

# good
something.is_a?(Array)
(1..100).include?(7)
some_string =~ /something/
Severity
Category
Status
Source
Language