wrstudios/frodata

View on GitHub

Showing 507 of 507 total issues

Line is too long. [93/80]
Open

      @services << service if service.is_a?(FrOData::Service) && !@services.include?(service)
Severity: Minor
Found in lib/frodata/service_registry.rb by rubocop

Avoid rescuing without specifying an error class.
Open

        rescue => ex

This cop checks for rescuing StandardError. There are two supported styles implicit and explicit. This cop will not register an offense if any error other than StandardError is specified.

Example: EnforcedStyle: implicit

# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.

# bad
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Example: EnforcedStyle: explicit (default)

# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.

# bad
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Line is too long. [84/80]
Open

      raise ArgumentError, 'Namespace missing' if namespace.nil? || namespace.empty?
Severity: Minor
Found in lib/frodata/service.rb by rubocop

Use || instead of or.
Open

      @name     = options[:name] or raise ArgumentError, 'Name is required'
Severity: Minor
Found in lib/frodata/navigation_property.rb by rubocop

This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

Example: EnforcedStyle: always (default)

# bad
foo.save and return

# bad
if foo and bar
end

# good
foo.save && return

# good
if foo && bar
end

Example: EnforcedStyle: conditionals

# bad
if foo and bar
end

# good
foo.save && return

# good
foo.save and return

# good
if foo && bar
end

Do not use space inside array brackets.
Open

          [ "#{namespace}.#{name}", complex_type ]
Severity: Minor
Found in lib/frodata/service.rb by rubocop

Checks that brackets used for array literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that array literals have
# surrounding space.

# bad
array = [a, b, c, d]

# good
array = [ a, b, c, d ]

Example: EnforcedStyle: no_space

# The `no_space` style enforces that array literals have
# no surrounding space.

# bad
array = [ a, b, c, d ]

# good
array = [a, b, c, d]

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# array brackets, with the exception that successive left
# or right brackets are collapsed together in nested arrays.

# bad
array = [ a, [ b, c ] ]

# good
array = [ a, [ b, c ]]

Line is too long. [91/80]
Open

      raise ArgumentError, "Unknown Entity Set: #{entity_set_name}" if entity_set_node.nil?
Severity: Minor
Found in lib/frodata/entity_container.rb by rubocop

Use attr_writer to define trivial writer methods.
Open

      def value=(value)

This cop looks for trivial reader/writer methods, that could have been created with the attr_* family of functions automatically.

Example:

# bad
def foo
  @foo
end

def bar=(val)
  @bar = val
end

def self.baz
  @baz
end

# good
attr_reader :foo
attr_writer :bar

class << self
  attr_reader :baz
end
Severity
Category
Status
Source
Language