varvet/godmin

View on GitHub
lib/godmin/resolver.rb

Summary

Maintainability
A
45 mins
Test Coverage

Method _find_all has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _find_all(name, prefix, partial, details, key, locals)
Severity: Minor
Found in lib/godmin/resolver.rb - About 45 mins to fix

    Avoid parameter lists longer than 5 parameters. [6/5]
    Open

        def _find_all(name, prefix, partial, details, key, locals)
    Severity: Minor
    Found in lib/godmin/resolver.rb by rubocop

    This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

    Use %r around regular expression.
    Open

          prefix.sub(/\A#{@controller_path}/, "resource").sub(/\A\//, "")
    Severity: Minor
    Found in lib/godmin/resolver.rb by rubocop

    This cop enforces using // or %r around regular expressions.

    Example: EnforcedStyle: slashes (default)

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = %r{
      foo
      (bar)
      (baz)
    }x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = /
      foo
      (bar)
      (baz)
    /x

    Example: EnforcedStyle: percent_r

    # bad
    snake_case = /^[\dA-Z_]+$/
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = %r{^[\dA-Z_]+$}
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: EnforcedStyle: mixed

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: AllowInnerSlashes: false (default)

    # If `false`, the cop will always recommend using `%r` if one or more
    # slashes are found in the regexp string.
    
    # bad
    x =~ /home\//
    
    # good
    x =~ %r{home/}

    Example: AllowInnerSlashes: true

    # good
    x =~ /home\//

    Use %r around regular expression.
    Open

          prefix.sub(/\A#{@controller_path}/, File.join(@engine_wrapper.namespaced_path, "resource")).sub(/\A\//, "")
    Severity: Minor
    Found in lib/godmin/resolver.rb by rubocop

    This cop enforces using // or %r around regular expressions.

    Example: EnforcedStyle: slashes (default)

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = %r{
      foo
      (bar)
      (baz)
    }x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = /
      foo
      (bar)
      (baz)
    /x

    Example: EnforcedStyle: percent_r

    # bad
    snake_case = /^[\dA-Z_]+$/
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = %r{^[\dA-Z_]+$}
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: EnforcedStyle: mixed

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: AllowInnerSlashes: false (default)

    # If `false`, the cop will always recommend using `%r` if one or more
    # slashes are found in the regexp string.
    
    # bad
    x =~ /home\//
    
    # good
    x =~ %r{home/}

    Example: AllowInnerSlashes: true

    # good
    x =~ /home\//

    Use %r around regular expression.
    Open

          prefix.sub(/\A#{File.join(@engine_wrapper.namespaced_path)}/, "").sub(/\A\//, "")
    Severity: Minor
    Found in lib/godmin/resolver.rb by rubocop

    This cop enforces using // or %r around regular expressions.

    Example: EnforcedStyle: slashes (default)

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = %r{
      foo
      (bar)
      (baz)
    }x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = /
      foo
      (bar)
      (baz)
    /x

    Example: EnforcedStyle: percent_r

    # bad
    snake_case = /^[\dA-Z_]+$/
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = %r{^[\dA-Z_]+$}
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: EnforcedStyle: mixed

    # bad
    snake_case = %r{^[\dA-Z_]+$}
    
    # bad
    regex = /
      foo
      (bar)
      (baz)
    /x
    
    # good
    snake_case = /^[\dA-Z_]+$/
    
    # good
    regex = %r{
      foo
      (bar)
      (baz)
    }x

    Example: AllowInnerSlashes: false (default)

    # If `false`, the cop will always recommend using `%r` if one or more
    # slashes are found in the regexp string.
    
    # bad
    x =~ /home\//
    
    # good
    x =~ %r{home/}

    Example: AllowInnerSlashes: true

    # good
    x =~ /home\//

    There are no issues that match your filters.

    Category
    Status