wycleffsean/haypub

View on GitHub
lib/payhub/hash_builder.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(key, *args, &block)
      @hash[key] = args.first
    end
Severity: Minor
Found in lib/payhub/hash_builder.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

Ambiguous block operator. Parenthesize the method arguments if it's surely a block operator, or add a whitespace to the right of the & if it should be a binary AND.
Open

      instance_eval &block
Severity: Minor
Found in lib/payhub/hash_builder.rb by rubocop

This cop checks for ambiguous operators in the first argument of a method invocation without parentheses.

Example:

# bad

# The `*` is interpreted as a splat operator but it could possibly be
# a `*` method invocation (i.e. `do_something.*(some_array)`).
do_something *some_array

Example:

# good

# With parentheses, there's no ambiguity.
do_something(*some_array)

Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
Open

    def method_missing(key, *args, &block)
Severity: Minor
Found in lib/payhub/hash_builder.rb by rubocop

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

Missing top-level class documentation comment.
Open

  class HashBuilder
Severity: Minor
Found in lib/payhub/hash_builder.rb by rubocop

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

There are no issues that match your filters.

Category
Status