NexusSW/nio4r-websocket

View on GitHub
lib/nio/websocket/adapter.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
92%

Missing top-level class documentation comment.
Open

    class Adapter < RawAdapter
Severity: Minor
Found in lib/nio/websocket/adapter.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

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

require "nio/websocket/raw_adapter"
Severity: Minor
Found in lib/nio/websocket/adapter.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

          WebSocket.logger.info "Driver initiated #{inner} close (code #{ev.code}): #{ev.reason}"
Severity: Minor
Found in lib/nio/websocket/adapter.rb by rubocop

Use nested module/class definitions instead of compact style.
Open

class ::WebSocket::Driver
Severity: Minor
Found in lib/nio/websocket/adapter.rb by rubocop

This cop checks the style of children definitions at classes and modules. Basically there are two different styles:

Example: EnforcedStyle: nested (default)

# good
# have each child on its own line
class Foo
  class Bar
  end
end

Example: EnforcedStyle: compact

# good
# combine definitions as much as possible
class Foo::Bar
end

The compact style is only forced for classes/modules with one child.

Line is too long. [82/80]
Open

          WebSocket.logger.error "Driver reports error on #{inner}: #{ev.message}"
Severity: Minor
Found in lib/nio/websocket/adapter.rb by rubocop

Missing top-level class documentation comment.
Open

class ::WebSocket::Driver
Severity: Minor
Found in lib/nio/websocket/adapter.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

There are no issues that match your filters.

Category
Status