lib/bos_client/error.rb

Summary

Maintainability
A
0 mins
Test Coverage

The use of eval is a serious security risk.
Open

          eval "BosClient::Error::#{name}.new \"#{message}\""
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

This cop checks for the use of Kernel#eval and Binding#eval.

Example:

# bad

eval(something)
binding.eval(something)

Pass __FILE__ and __LINE__ to eval method, as they are used by backtraces.
Open

          eval "BosClient::Error::#{name}.new \"#{message}\""
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

This cop checks eval method usage. eval can receive source location metadata, that are filename and line number. The metadata is used by backtraces. This cop recommends to pass the metadata to eval method.

Example:

# bad
eval <<-RUBY
  def do_something
  end
RUBY

# bad
C.class_eval <<-RUBY
  def do_something
  end
RUBY

# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
  def do_something
  end
RUBY

# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
  def do_something
  end
RUBY

Missing top-level class documentation comment.
Open

  class Error < StandardError
Severity: Minor
Found in lib/bos_client/error.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

Unnecessary utf-8 encoding comment.
Open

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

Line is too long. [91/80]
Open

          BosClient::Error.const_set(name.to_sym, Class.new(BosClient::Error)).new(message)
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

Add an empty line after magic comments.
Open

module BosClient
Severity: Minor
Found in lib/bos_client/error.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

There are no issues that match your filters.

Category
Status