Showing 21 of 21 total issues
Method to_s
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
expand = ASSIGN_NODES.include? exp.first.first
c = process exp.shift
t = process exp.shift
f = process exp.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 to_s
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
receiver_node_type = exp.first.nil? ? nil : exp.first.first
receiver = process exp.shift
receiver = "(#{receiver})" if ASSIGN_NODES.include? receiver_node_type
- 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
File processor.rb
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'sexp_processor'
module Sexp2Ruby
# Generate ruby code from a sexp.
Method to_s
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
type1 = exp[1].first
type2 = exp[2].first rescue nil
expect = [:ivar, :iasgn, :attrset]
- 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 to_s
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
case exp.first
when Sexp then
lhs = exp.shift
rhs = exp.empty? ? nil : exp.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 to_s
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(exp)
type1 = exp[1].first
type2 = exp[2].first rescue nil
expect = [:ivar, :iasgn, :attrset]
Method to_s
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(exp)
receiver_node_type = exp.first.nil? ? nil : exp.first.first
receiver = process exp.shift
receiver = "(#{receiver})" if ASSIGN_NODES.include? receiver_node_type
Method to_s
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
result = []
until exp.empty?
s = exp.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 to_s
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
body = process(exp.shift) unless exp.first.first == :resbody
els = process(exp.pop) unless exp.last.first == :resbody
body ||= "# do nothing"
- 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 to_s
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(exp)
call_sexp = exp.shift
# Process the `Call`. The Sexp is not consumed here (it is cloned)
# because we will need to refer to it later, when determining which
Method to_s
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(exp)
case exp.first
when Sexp then
lhs = exp.shift
rhs = exp.empty? ? nil : exp.shift
Method util_module_or_class
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def util_module_or_class(exp, is_class=false)
result = []
name = exp.shift
name = process name if Sexp === name
- 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 to_s
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(exp)
expand = ASSIGN_NODES.include? exp.first.first
c = process exp.shift
t = process exp.shift
f = process exp.shift
Method to_s
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
result = []
expr = process exp.shift
if expr
result << "case #{expr}"
- 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 to_s
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
call_sexp = exp.shift
# Process the `Call`. The Sexp is not consumed here (it is cloned)
# because we will need to refer to it later, when determining which
- 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 to_s
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
result = []
exp << nil if exp.empty?
until exp.empty? do
- 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 to_s
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_s(exp)
receiver = process exp.shift
name = exp.shift
rhs = exp.pop
args = s(:array, *exp)
- 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 rewrite_rescue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rewrite_rescue exp
complex = false
complex ||= exp.size > 3
complex ||= exp.resbody.block
complex ||= exp.resbody.size > 3
- 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 cond_loop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cond_loop(exp, name)
cond = process(exp.shift)
body = process(exp.shift)
head_controlled = exp.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 util_dthing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def util_dthing(type, exp)
s = []
# first item in sexp is a string literal
s << dthing_escape(type, exp.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"