reactrb/reactive-record

View on GitHub
lib/json_parse_patch.rb

Summary

Maintainability
A
0 mins
Test Coverage

Ambiguous splat operator. Parenthesize the method arguments if it's surely a splat operator, or add a whitespace to the right of the * if it should be a multiplication.
Open

      old_parse *args, &block
Severity: Minor
Found in lib/json_parse_patch.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)

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception => e
  JSON.class_eval do
    class << self
      alias old_parse parse
    end
Severity: Minor
Found in lib/json_parse_patch.rb by rubocop

This cop checks for rescue blocks targeting the Exception class.

Example:

# bad

begin
  do_something
rescue Exception
  handle_exception
end

Example:

# good

begin
  do_something
rescue ArgumentError
  handle_exception
end

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

    rescue Exception => e
      raise StandardError.new e.message
Severity: Minor
Found in lib/json_parse_patch.rb by rubocop

This cop checks for rescue blocks targeting the Exception class.

Example:

# bad

begin
  do_something
rescue Exception
  handle_exception
end

Example:

# good

begin
  do_something
rescue ArgumentError
  handle_exception
end

There are no issues that match your filters.

Category
Status