lib/ext/core/string.rb
Showing 2 of 2 total issues
Method default_encoding!
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def default_encoding! default_encoding = Encoding.default_internal || Encoding::UTF_8 if ascii_only? # no need to encode if ascii force_encoding(default_encoding) else # should encode
- Read upRead up
Method rtruncate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def rtruncate(length, options = {}) chars = self.dup.mb_chars return self if chars.length <= length options[:omission] ||= "..." options[:separator] ||= '/'
- Read upRead up