locaweb/cassette

View on GitHub

Showing 65 of 65 total issues

Put empty method definitions on a single line.
Open

      def clear
      end
Severity: Minor
Found in lib/cassette/cache/null_store.rb by rubocop

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

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in lib/cassette/cache.rb by rubocop

Unnecessary utf-8 encoding comment.
Open

# encoding: UTF-8
Severity: Minor
Found in lib/cassette.rb by rubocop

Place the . on the next line, together with the method name.
Open

            elements.

This cop checks the . position in multi-line method calls.

Example: EnforcedStyle: leading (default)

# bad
something.
  mehod

# good
something
  .method

Example: EnforcedStyle: trailing

# bad
something
  .method

# good
something.
  mehod

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

        if @login

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok
Severity
Category
Status
Source
Language