rakuten-ws/rws-ruby-sdk

View on GitHub
lib/rakuten_web_service/travel/area_class.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
98%

Assignment Branch Condition size for parse_children_attributes is too high. [18.79/15]
Open

        def parse_children_attributes
          return @children = [] if children.nil? || children.empty?

          children_class = children.keys.first[/\A(\w*)Classes\Z/, 1]
          class_name = "#{children_class}Classes"

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Replace class var @@area_classes with a class instance var.
Open

            @@area_classes ||= {}

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

Replace class var @@repository with a class instance var.
Open

            @@repository ||= Hash.new { |h, k| h[k] = {} }

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

Missing top-level module documentation comment.
Open

    module AreaClass

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

Line is too long. [93/80]
Open

            Base.area_classes[children_class].new(child_data["#{children_class}Class"], self)

Missing top-level class documentation comment.
Open

      class Base < RakutenWebService::Travel::Resource

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