autotelik/datashift

View on GitHub
lib/datashift/logging.rb

Summary

Maintainability
A
0 mins
Test Coverage

When using method_missing, define respond_to_missing? and fall back on super.
Open

      def method_missing(method, *args, &block)
        @targets.each { |t| t.send(method, *args, &block) }
      end
Severity: Minor
Found in lib/datashift/logging.rb by rubocop

This cop checks for the presence of method_missing without also defining respond_to_missing? and falling back on super.

Example:

#bad
def method_missing(name, *args)
  # ...
end

#good
def respond_to_missing?(name, include_private)
  # ...
end

def method_missing(name, *args)
  # ...
  super
end

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

        unless @names.include?(target)
Severity: Minor
Found in lib/datashift/logging.rb by rubocop

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

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

        unless @names.include?(target)
Severity: Minor
Found in lib/datashift/logging.rb by rubocop

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

There are no issues that match your filters.

Category
Status