Dalphi/dalphi

View on GitHub
app/validators/http_response_validator.rb

Summary

Maintainability
A
0 mins
Test Coverage

Do not use :: for method calls.
Open

    elsif !UrlResponseChecker::check_response url

This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).

Example:

# bad
Timeout::timeout(500) { do_something }
FileUtils::rmdir(dir)
Marshal::dump(obj)

# good
Timeout.timeout(500) { do_something }
FileUtils.rmdir(dir)
Marshal.dump(obj)

Line is too long. [95/80]
Open

    error_message = I18n.t('activerecord.errors.models.service.attributes.url.badHttpResponse')

Put empty method definitions on a single line.
Open

  def initialize(_model)
  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

Missing top-level class documentation comment.
Open

class HttpResponseValidator < ActiveModel::Validator

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

Line is too long. [85/80]
Open

    error_message = I18n.t('activerecord.errors.models.service.attributes.url.isNil')

There are no issues that match your filters.

Category
Status