Method to_localized_h
has a Cognitive Complexity of 14 (exceeds 6 allowed). Consider refactoring. Open
def to_localized_h
is_presets_only = presets_only?
result = {}
CONTEXTS.each do |context|
result[context] = Hash.new
- 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 revert_presets_to_short_name
has a Cognitive Complexity of 13 (exceeds 6 allowed). Consider refactoring. Open
def revert_presets_to_short_name
CONTEXTS.each do |context|
next if help_text[context].blank?
PRESETS[context].each do |preset|
LOCALES.each do |locale|
- 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 presets_only?
has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring. Open
def presets_only?
CONTEXTS.each do |context|
next unless help_text[context]
LOCALES.each do |locale|
next if help_text[context][locale].blank?
- 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 blank?
has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring. Open
def blank?
CONTEXTS.any? do |context|
next unless help_text[context]
help_text[context].values.any? do |value|
return false unless blank_text?(value)
- 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"