Method shift_balanced_embexpr
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def shift_balanced_embexpr(tokens)
String.new.tap do |embedded|
embexpr_open = 1
until tokens.empty?
- 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 compile_tokens!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compile_tokens!(exps, tokens)
beg_str, end_str = strip_quotes!(tokens)
until tokens.empty?
_, type, str = tokens.shift
- 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 on_dynamic
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def on_dynamic(code)
return [:dynamic, code] unless string_literal?(code)
return [:dynamic, code] if code.include?("\n")
temple = [:multi]
- 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 compile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compile(code)
[].tap do |exps|
tokens = Ripper.lex(code.strip)
tokens.pop while tokens.last && [:on_comment, :on_sp].include?(tokens.last[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 string_literal?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def string_literal?(code)
return false if SyntaxChecker.syntax_error?(code)
type, instructions = Ripper.sexp(code)
return false if type != :program
- 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"