wrstudios/frodata

View on GitHub

Showing 507 of 507 total issues

Missing top-level class documentation comment.
Open

      class LineString < Base

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

Freeze mutable objects assigned to constants.
Open

    ERROR_MAP = []
Severity: Minor
Found in lib/frodata/errors.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Freeze mutable objects assigned to constants.
Open

    SERVER_ERRORS = {
      500 => "Internal Server Error",
      503 => "Service Unavailable"
    }
Severity: Minor
Found in lib/frodata/errors.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Surrounding space missing in default value assignment.
Open

    def [](key, options={})
Severity: Minor
Found in lib/frodata/entity_set.rb by rubocop

Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.

Example:

# bad
def some_method(arg1=:default, arg2=nil, arg3=[])
  # do something...
end

# good
def some_method(arg1 = :default, arg2 = nil, arg3 = [])
  # do something...
end

Unused method argument - entity_options. If it's necessary, use _ or _entity_options as an argument name to indicate that it won't be used. You can also write as parse_entity(*) if you want the method to accept any arguments but don't care about them.
Open

        def parse_entity(entity_data, entity_options)
Severity: Minor
Found in lib/frodata/service/response/xml.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 module documentation comment.
Open

      module JSON

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

Rename is_xml? to xml?.
Open

      def is_xml?
Severity: Minor
Found in lib/frodata/service/response.rb by rubocop

This cop makes sure that predicates are named properly.

Example:

# bad
def is_even?(value)
end

# good
def even?(value)
end

# bad
def has_value?
end

# good
def value?
end

Reverse the order of the operands 200 <= status.
Open

        200 <= status && status < 300
Severity: Minor
Found in lib/frodata/service/response.rb by rubocop

This cop checks for Yoda conditions, i.e. comparison operations where readability is reduced because the operands are not ordered the same way as they would be ordered in spoken English.

Example: EnforcedStyle: allcomparisonoperators (default)

# bad
99 == foo
"bar" != foo
42 >= foo
10 < bar

# good
foo == 99
foo == "bar"
foo <= 42
bar > 10

Example: EnforcedStyle: equalityoperatorsonly

# bad
99 == foo
"bar" != foo

# good
99 >= foo
3 < a && a < 5

Line is too long. [88/80]
Open

      @navigation_properties ||= metadata.xpath('//EntityType').map do |entity_type_def|
Severity: Minor
Found in lib/frodata/schema.rb by rubocop

Use 2 (not -30) spaces for indentation.
Open

        Rails.logger
      else
        default_logger
Severity: Minor
Found in lib/frodata/service.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

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

          properties.each do |name, property|
Severity: Minor
Found in lib/frodata/properties/complex.rb by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

Line is too long. [82/80]
Open

          raise ArgumentError, 'Multiple values are not allowed for this property'
Severity: Minor
Found in lib/frodata/properties/enum.rb by rubocop

Missing top-level class documentation comment.
Open

      class Base < FrOData::Property

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

Avoid the use of Perl-style backrefs.
Open

            coords_from_s($4)

This cop looks for uses of Perl-style regexp match backreferences like $1, $2, etc.

Example:

# bad
puts $1

# good
puts Regexp.last_match(1)

Use 2 (not -21) spaces for indentation.
Open

        new_entity.navigation_property_names
Severity: Minor
Found in lib/frodata/entity_set.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Line is too long. [90/80]
Open

        entity[entity.primary_key] = primary_key_node.content unless primary_key_node.nil?
Severity: Minor
Found in lib/frodata/entity_set.rb by rubocop

Unused method argument - entity_data. If it's necessary, use _ or _entity_data as an argument name to indicate that it won't be used. You can also write as parse_entity(*) if you want the method to accept any arguments but don't care about them.
Open

        def parse_entity(entity_data, entity_options)
Severity: Minor
Found in lib/frodata/service/response/xml.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

Line is too long. [81/80]
Open

          raise RequestError, response, "Invalid response type '#{content_type}'"
Severity: Minor
Found in lib/frodata/service/response.rb by rubocop

Annotation keywords like TODO should be all upper case, followed by a colon, and a space, then a note describing the problem.
Open

      # TODO Populate FrOData::ServiceRegistry based on configuration
Severity: Minor
Found in lib/frodata/railtie.rb by rubocop

This cop checks that comment annotation keywords are written according to guidelines.

Example:

# bad
# TODO make better

# good
# TODO: make better

# bad
# TODO:make better

# good
# TODO: make better

# bad
# fixme: does not work

# good
# FIXME: does not work

# bad
# Optimize does not work

# good
# OPTIMIZE: does not work

Final newline missing.
Open

end
Severity: Minor
Found in lib/frodata/property_registry.rb by rubocop
Severity
Category
Status
Source
Language