Method clauses_churn_delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def clauses_churn_delete
@clauses_deleted.each do | mixin |
pattern = /(\[\{\{#{mixin}\}\}\s*?)(.*?\n*?)(\])/m
sub_pattern = /\[\{\{(\S+?)\}\}\s*?/
@content[pattern]
- 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 clauses_churn_add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def clauses_churn_add
@clauses_added.each do | mixin |
pattern = /(\[\{\{#{mixin}\}\}\s*?)(.*?\n*?)(\])/m
sub_pattern = /\[\{\{(\S+?)\}\}\s*?/
@content[pattern]
- 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 text_mixins
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def text_mixins
@headers.each do | mixin, replacer |
unless mixin =~ /level-\d/ or mixin =~ /no-reset/ or mixin =~ /no-indent/ or mixin =~ /level-style/
replacer = replacer.to_s
mixin_pattern = /(\{\{#{mixin}\}\})/
- 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"