pboling/celluloid-io-pg-listener

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

Summary

Maintainability
A
0 mins
Test Coverage

Use caller(1..1).first instead of caller.first.
Open

    puts "unlisten wrapper: #{wrapper},\nunlisten_wrapper_type: #{unlisten_wrapper_type},\ncaller: #{caller.first}"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

This cop identifies places where caller[n] can be replaced by caller(n..n).first.

Example:

# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first

# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first

Line is too long. [86/80]
Open

  # Redefining this constant would allow you to set whatever unlisten wrapper you want
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
Open

      unlisten_wrapper_with_termination: "CelluloidIOPGListener::UnlistenWrappers::WithTermination",
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

This cops checks the indentation of the first key in a hash literal where the opening brace and the first key are on separate lines. The other keys' indentations are handled by the AlignHash cop.

By default, Hash literals that are arguments in a method call with parentheses, and where the opening curly brace of the hash is on the same line as the opening parenthesis of the method call, shall have their first key indented one step (two spaces) more than the position inside the opening parenthesis.

Other hash literals shall have their first key indented one step more than the start of the line where the opening curly brace is.

This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_braces'. Here are examples:

Example: EnforcedStyle: specialinsideparentheses (default)

# The `special_inside_parentheses` style enforces that the first key
# in a hash literal where the opening brace and the first key are on
# separate lines is indented one step (two spaces) more than the
# position inside the opening parentheses.

# bad
hash = {
  key: :value
}
and_in_a_method_call({
  no: :difference
                     })

# good
special_inside_parentheses
hash = {
  key: :value
}
but_in_a_method_call({
                       its_like: :this
                     })

Example: EnforcedStyle: consistent

# The `consistent` style enforces that the first key in a hash
# literal where the opening brace and the first key are on
# seprate lines is indented the same as a hash literal which is not
# defined inside a method call.

# bad
hash = {
  key: :value
}
but_in_a_method_call({
                       its_like: :this
                      })

# good
hash = {
  key: :value
}
and_in_a_method_call({
  no: :difference
})

Example: EnforcedStyle: align_braces

# The `align_brackets` style enforces that the opening and closing
# braces are indented to the same position.

# bad
and_now_for_something = {
                          completely: :different
}

# good
and_now_for_something = {
                          completely: :different
                        }

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

require "celluloid-io-pg-listener/version"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

require "celluloid/io"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

      unlisten_wrapper_without_termination: "CelluloidIOPGListener::UnlistenWrappers::WithoutTermination"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

require "celluloid-io-pg-listener/unlisten_wrappers/without_termination"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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. [115/80]
Open

    puts "unlisten wrapper: #{wrapper},\nunlisten_wrapper_type: #{unlisten_wrapper_type},\ncaller: #{caller.first}"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Freeze mutable objects assigned to constants.
Open

  UNLISTEN_WRAPPER_TYPE = {
      unlisten_wrapper_with_termination: "CelluloidIOPGListener::UnlistenWrappers::WithTermination",
      unlisten_wrapper_without_termination: "CelluloidIOPGListener::UnlistenWrappers::WithoutTermination"
  }
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

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

require "celluloid-io-pg-listener/client"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

require "celluloid-io-pg-listener/unlisten_wrappers/with_termination"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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. [100/80]
Open

      unlisten_wrapper_with_termination: "CelluloidIOPGListener::UnlistenWrappers::WithTermination",
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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

require "celluloid-io-pg-listener/initialization/argument_extraction"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

require "celluloid-io-pg-listener/initialization/async_listener"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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. [97/80]
Open

# Require in your executable script that runs your supervisor.  See bin/supervisor as an example.
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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

require "celluloid/current" # See https://github.com/celluloid/celluloid/wiki/DEPRECATION-WARNING
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

Extra empty line detected at module body beginning.
Open


  # Redefining this constant would allow you to set whatever unlisten wrapper you want
Severity: Minor
Found in lib/celluloid-io-pg-listener.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

Line is too long. [83/80]
Open

  #     include CelluloidIOPGListener.client(:unlisten_wrapper_without_termination)
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Line is too long. [115/80]
Open

  #     include CelluloidIOPGListener.client(:unlisten_wrapper_with_termination) # with no argument this is default
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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

      unlisten_wrapper_with_termination: "CelluloidIOPGListener::UnlistenWrappers::WithTermination",
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

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

require "celluloid-io-pg-listener/initialization/client_extracted_signature"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

Extra empty line detected at module body end.
Open


end
Severity: Minor
Found in lib/celluloid-io-pg-listener.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

Line is too long. [89/80]
Open

  #   At least that's my operating hypothesis, if anyone knows better please let me know.
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Line is too long. [105/80]
Open

      unlisten_wrapper_without_termination: "CelluloidIOPGListener::UnlistenWrappers::WithoutTermination"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

Line is too long. [114/80]
Open

  # For a Client that will be used inside a SupervisorContainer you want to let the Supervisor handle termination.
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

The name of this source file (celluloid-io-pg-listener.rb) should use snake_case.
Open

require "celluloid-io-pg-listener/version"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.

Example:

# bad
lib/layoutManager.rb

anything/usingCamelCase

# good
lib/layout_manager.rb

anything/using_snake_case.rake

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

require "pg"
Severity: Minor
Found in lib/celluloid-io-pg-listener.rb by rubocop

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"

There are no issues that match your filters.

Category
Status