codeclimate/codeclimate-yaml

View on GitHub
lib/cc/yaml/nodes/node.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Class Node has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

      class Node
        def self.has_default?
          false
        end

Severity: Minor
Found in lib/cc/yaml/nodes/node.rb - About 3 hrs to fix

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

            def visit_pair(visitor, key, value)
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.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

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

            def visit_unexpected(visitor, value, message = nil)
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.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

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

            def respond_to_missing?(method, include_private = false)
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.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

    Put empty method definitions on a single line.
    Open

            def prepare
            end
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.rb by rubocop

    This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

    Note: A method definition is not considered empty if it contains comments.

    Example: EnforcedStyle: compact (default)

    # bad
    def foo(bar)
    end
    
    def self.foo(bar)
    end
    
    # good
    def foo(bar); end
    
    def foo(bar)
      # baz
    end
    
    def self.foo(bar); end

    Example: EnforcedStyle: expanded

    # bad
    def foo(bar); end
    
    def self.foo(bar); end
    
    # good
    def foo(bar)
    end
    
    def self.foo(bar)
    end

    Put empty method definitions on a single line.
    Open

            def verify
            end
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.rb by rubocop

    This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

    Note: A method definition is not considered empty if it contains comments.

    Example: EnforcedStyle: compact (default)

    # bad
    def foo(bar)
    end
    
    def self.foo(bar)
    end
    
    # good
    def foo(bar); end
    
    def foo(bar)
      # baz
    end
    
    def self.foo(bar); end

    Example: EnforcedStyle: expanded

    # bad
    def foo(bar); end
    
    def self.foo(bar); end
    
    # good
    def foo(bar)
    end
    
    def self.foo(bar)
    end

    Inconsistent indentation detected.
    Open

              def dup_values
                self
              end
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.rb by rubocop

    This cops checks for inconsistent indentation.

    Example:

    class A
      def test
        puts 'hello'
         puts 'world'
      end
    end

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

            def visit_scalar(visitor, type, value, implicit = true)
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.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

    Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
    Open

              error(message || "unexpected %p", value)
    Severity: Minor
    Found in lib/cc/yaml/nodes/node.rb by rubocop

    Use a consistent style for named format string tokens.

    Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

    Example: EnforcedStyle: annotated (default)

    # bad
    format('%{greeting}', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%<greeting>s', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: template

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%{greeting}', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: unannotated

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%{greeting}', 'Hello')
    
    # good
    format('%s', 'Hello')</greeting>

    There are no issues that match your filters.

    Category
    Status