armandofox/audience1st

View on GitHub
lib/core_extensions/string/name.rb

Summary

Maintainability
A
30 mins
Test Coverage
C
77%

Avoid too many return statements within this method.
Open

        return self.gsub(/^(\w)|-(\w)/) { |a| a.upcase }
Severity: Major
Found in lib/core_extensions/string/name.rb - About 30 mins to fix

    Redundant use of Object#to_s in interpolation.
    Open

            tagstart,tagend = "<#{tag.to_s} #{tag_opts_str}>", "</#{tag.to_s}>"
    Severity: Minor
    Found in lib/core_extensions/string/name.rb by rubocop

    This cop checks for string conversion in string interpolation, which is redundant.

    Example:

    # bad
    
    "result is #{something.to_s}"

    Example:

    # good
    
    "result is #{something}"

    Redundant use of Object#to_s in interpolation.
    Open

            tagstart,tagend = "<#{tag.to_s} #{tag_opts_str}>", "</#{tag.to_s}>"
    Severity: Minor
    Found in lib/core_extensions/string/name.rb by rubocop

    This cop checks for string conversion in string interpolation, which is redundant.

    Example:

    # bad
    
    "result is #{something.to_s}"

    Example:

    # good
    
    "result is #{something}"

    Unused block argument - i. You can omit the argument if you don't care about it.
    Open

              1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }
    Severity: Minor
    Found in lib/core_extensions/string/name.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

    There are no issues that match your filters.

    Category
    Status