lib/core_extensions/string/name.rb
Avoid too many return
statements within this method. Open
Open
return self.gsub(/^(\w)|-(\w)/) { |a| a.upcase }
Redundant use of Object#to_s
in interpolation. Open
Open
tagstart,tagend = "<#{tag.to_s} #{tag_opts_str}>", "</#{tag.to_s}>"
- Read upRead up
- Exclude checks
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
Open
tagstart,tagend = "<#{tag.to_s} #{tag_opts_str}>", "</#{tag.to_s}>"
- Read upRead up
- Exclude checks
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
Open
1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }
- Read upRead up
- Exclude checks
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