NullVoxPopuli/meshchat

View on GitHub
lib/meshchat/network/message/base.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method Meshchat::Network::Message::Base#payload is defined at both lib/meshchat/network/message/base.rb:13 and lib/meshchat/network/message/base.rb:45.
Open

        def payload

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end

Prefer Date or Time over DateTime. (https://github.com/bbatsov/ruby-style-guide#date--time)
Open

          DateTime.parse(time_received) if time_received

This cop checks for uses of DateTime that should be replaced by Date or Time.

Example:

# bad - uses `DateTime` for current time
DateTime.now

# good - uses `Time` for current time
Time.now

# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')

# good - uses `Date` for modern date
Date.iso8601('2016-06-29')

# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)

Add an empty line after magic comments. (https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code)
Open

module Meshchat

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Put empty method definitions on a single line. (https://github.com/bbatsov/ruby-style-guide#no-single-line-methods)
Open

        def respond
        end

This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

Note: A method definition is not considered empty if it contains comments.

Example: EnforcedStyle: compact (default)

# bad
def foo(bar)
end

def self.foo(bar)
end

# good
def foo(bar); end

def foo(bar)
  # baz
end

def self.foo(bar); end

Example: EnforcedStyle: expanded

# bad
def foo(bar); end

def self.foo(bar); end

# good
def foo(bar)
end

def self.foo(bar)
end

There are no issues that match your filters.

Category
Status