Showing 11 of 22 total issues
Method transliterate_roman
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def transliterate_roman(data, map, options = {})
data = data.to_str.chars
buf = []
token_buffer = []
had_consonant = false
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method transliterate_brahmic
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def transliterate_brahmic(data, map)
data = data.to_str.chars
buf = []
had_roman_consonant = false
transliteration_enabled = true
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method transliterate_roman
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transliterate_roman(data, map, options = {})
data = data.to_str.chars
buf = []
token_buffer = []
had_consonant = false
Method transliterate_brahmic
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transliterate_brahmic(data, map)
data = data.to_str.chars
buf = []
had_roman_consonant = false
transliteration_enabled = true
Method make_map
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_map(from, to)
@cache[:"#{from}_#{to}"] ||= begin
alternates = @all_alternates[from] || {}
consonants = {}
from_scheme = @schemes[from]
Method transliterate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def transliterate(data, from, to, **opts)
from = from.to_sym
to = to.to_sym
return data if from == to
raise SchemeNotSupportedError, from unless @schemes.key?(from)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method ruby_detect_scheme
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ruby_detect_scheme(text) # rubocop:disable AbcSize, PerceivedComplexity
text = text.to_str.gsub(RE_CONTROL_BLOCK, "")
# Brahmic schemes are all within a specific range of code points.
brahmic_char = text[RE_BRAHMIC_RANGE]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method ruby_detect_scheme
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ruby_detect_scheme(text) # rubocop:disable AbcSize, PerceivedComplexity
text = text.to_str.gsub(RE_CONTROL_BLOCK, "")
# Brahmic schemes are all within a specific range of code points.
brahmic_char = text[RE_BRAHMIC_RANGE]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
buf << map[:virama] unless options[:syncope]
Avoid deeply nested control flow statements. Open
if (temp_mark = map[:marks][token])
buf << temp_mark
elsif token != "a"
buf.push(map[:virama], temp_letter)
end
Method rust_load!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rust_load!
# :nocov:
return RUST_AVAILABLE if defined?(RUST_AVAILABLE)
require "thermite/fiddle"
Thermite::Fiddle.load_module("init_rusty_sanscript",
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"