Method to_i
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def to_i(str)
str = str.to_s.tr(NUM_ALT_CHARS, NUM_NORMALIZED_CHARS)
str.gsub!(/[,,、[:space:]]/, '')
matched = REGEXP.match(str) or return 0
ret3 = 0
Method to_i
has 53 lines of code (exceeds 25 allowed). Consider refactoring.
def to_i(str)
str = str.to_s.tr(NUM_ALT_CHARS, NUM_NORMALIZED_CHARS)
str.gsub!(/[,,、[:space:]]/, '')
matched = REGEXP.match(str) or return 0
ret3 = 0
Method call
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
def call(num, _options = {})
return '零' if num.zero?
ret = ''
(UNIT_EXP4.reverse + ['']).each_with_index do |unit4, ridx4|
Method call
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def call(num, _options = {})
return '0' if num.zero?
ret = ''
(UNIT_EXP4.reverse + ['']).each_with_index do |unit4, ridx4|
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def call(num, _options = {})
return '0' if num.zero?
parts = []
(UNIT_EXP4.reverse + ['']).each_with_index do |unit4, ridx4|
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def call(num, _options = {})
return '〇' if num.zero?
ret = ''
head = true
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def call(num, _options = {})
return '0' if num.zero?
ret = ''
head = true