supherman/dustbag

View on GitHub
lib/dustbag/parser/node.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [15/10]
Open

        def children(*attrs)
          attrs.each do |attr|

            if attr.is_a?(Hash)
              attr.each do |key, value|
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [14/10]
Open

        def text_attributes(*attrs)
          attrs.each do |attr|
            node_name = xml_node_name(attr)

            if attr.is_a?(Hash)
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [14/10]
Open

        def numeric_attributes(*attrs)
          attrs.each do |attr|
            node_name = xml_node_name(attr)

            if attr.is_a?(Hash)
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for child is too high. [15.17/15]
Open

        def child(name)
          if name.is_a? Hash
            define_method(name[:name]) do
              (name[:class] || Dustbag.const_get(name[:node])).new(subnode(name[:node]))
            end
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

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

Line is too long. [88/80]
Open

              (name[:class] || Dustbag.const_get(name[:node])).new(subnode(name[:node]))
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

Missing top-level module documentation comment.
Open

    module Node
Severity: Minor
Found in lib/dustbag/parser/node.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

Missing top-level module documentation comment.
Open

      module ClassMethods
Severity: Minor
Found in lib/dustbag/parser/node.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

Extra empty line detected at block body beginning.
Open


            if attr.is_a?(Hash)
Severity: Minor
Found in lib/dustbag/parser/node.rb by rubocop

This cops checks if empty lines around the bodies of blocks match the configuration.

Example: EnforcedStyle: empty_lines

# good

foo do |bar|

  # ...

end

Example: EnforcedStyle: noemptylines (default)

# good

foo do |bar|
  # ...
end

There are no issues that match your filters.

Category
Status