bogdanRada/washout_builder

View on GitHub
lib/washout_builder/document/shared_complex_type.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use casecmp instead of downcase ==.
Open

          x.to_s.downcase == class_name.to_s.downcase ||

This cop identifies places where a case-insensitive string comparison can better be implemented using casecmp.

Example:

# bad
str.downcase == 'abc'
str.upcase.eql? 'ABC'
'abc' == str.downcase
'ABC'.eql? str.upcase
str.downcase == str.downcase

# good
str.casecmp('ABC').zero?
'abc'.casecmp(str).zero?

There are no issues that match your filters.

Category
Status