pboling/celluloid-io-pg-listener

View on GitHub
lib/celluloid-io-pg-listener/examples/listener_client_by_inheritance.rb

Summary

Maintainability
A
0 mins
Test Coverage

Extra empty line detected at class body beginning.
Open


      #

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

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Unused method argument - bus.
Open

      def initialize(a = nil, b = nil, bus: nil, fat: nil, **args)

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Extra empty line detected at class body end.
Open


    end

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

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Unused method argument - fat.
Open

      def initialize(a = nil, b = nil, bus: nil, fat: nil, **args)

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

        raise RuntimeError, "This example only works on the users_insert channel, you are notifying #{channel} with #{payload}" unless channel == "users_insert"

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Line is too long. [160/80]
Open

        raise RuntimeError, "This example only works on the users_insert channel, you are notifying #{channel} with #{payload}" unless channel == "users_insert"

Line is too long. [131/80]
Open

        # The initialize overrides will be called by super, and thus you have to be careful how you pass on the arguments to super.

Missing top-level class documentation comment.
Open

    class ListenerClientByInheritance < CelluloidIOPGListener::Examples::Client

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

Unused method argument - a. If it's necessary, use _ or _a as an argument name to indicate that it won't be used.
Open

      def initialize(a = nil, b = nil, bus: nil, fat: nil, **args)

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Redundant RuntimeError argument can be removed.
Open

        raise RuntimeError, "This example only works on the users_insert channel, you are notifying #{channel} with #{payload}" unless channel == "users_insert"

This cop checks for RuntimeError as the argument of raise/fail.

It checks for code like this:

Example:

# Bad
raise RuntimeError, 'message'

# Bad
raise RuntimeError.new('message')

# Good
raise 'message'

Line is too long. [126/80]
Open

        # Unlike in the original class, the prepends have been usurped since this overridden method is now highest precedence.

Unused method argument - b. If it's necessary, use _ or _b as an argument name to indicate that it won't be used.
Open

      def initialize(a = nil, b = nil, bus: nil, fat: nil, **args)

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

Line is too long. [84/80]
Open

        # <-- within the unlisten_wrapper's block if :foo_bar is the callback_method

There are no issues that match your filters.

Category
Status