thoughtbot/paperclip

View on GitHub
lib/paperclip/io_adapters/nil_adapter.rb

Summary

Maintainability
A
0 mins
Test Coverage

Space inside parentheses detected.
Open

  target.nil? || ( (Paperclip::Attachment === target) && !target.present? )

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Put empty method definitions on a single line.
Open

    def initialize(_target, _options = {})
    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

Unused method argument - args. If it's necessary, use _ or _args as an argument name to indicate that it won't be used. You can also write as read(*) if you want the method to accept any arguments but don't care about them.
Open

    def read(*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

Space inside parentheses detected.
Open

  target.nil? || ( (Paperclip::Attachment === target) && !target.present? )

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

There are no issues that match your filters.

Category
Status