Method eat_this
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def eat_this(line)
@rest = line + @rest
things_read = 0
until @rest.empty?
case self.state
- 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 eat_this
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eat_this(line)
@rest = line + @rest
things_read = 0
until @rest.empty?
case self.state
Method handle_tag
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def handle_tag
@already << @m.pre_match
@rest = @m.post_match
is_closing = !!@m[1]
- 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 handle_tag
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_tag
@already << @m.pre_match
@rest = @m.post_match
is_closing = !!@m[1]
Method close_script_style
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def close_script_style
tag = @tag_stack.last
# See http://www.w3.org/TR/xhtml1/#C_4 for character sequences not allowed within an element body.
if @already =~ /<|&|\]\]>|--/
- 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"