Showing 10 of 12 total issues
Class Javascript
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Javascript < Base
module Literals
BINOP_SWITCH = {
"==" => "===",
Class ICR
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ICR < Base
module Literals
def compile_number
n = shift(:number)
Method compile_class
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compile_class
delegate_if_class do
shift :class
name = shift :identifier
inherit = nil
Method _compile_group
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _compile_group(type, cond = false, continue = false)
shift type
if cond ||= block_given?
shift :lparen
- 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 _exec_context
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _exec_context(code)
out = buffer
out << "#{indent}\"use strict\";\n" if code[:strict]
unless code.locals.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 out
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def out(v)
if v.is_a?(Representable) || v.is_a?(Array)
@depth += 1
body = ["\n", " " * @depth, "(",
v.to_a.map {|d| out(d) }.compact.join(' '),
- 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 normalize_arguments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_arguments(args)
hash = if args.last.is_a? Hash
args.pop.dup
else
{}
- 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 _build_element
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _build_element(body, options, opts, part)
k, v = part
type = if k.is_a? Symbol then k else k.type end
- 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 replace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def replace(code, options = {})
method_name = :"generate_#{code.type}"
if method(method_name).arity.abs == 1
send(method_name, code)
- 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 lex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def lex(*args)
args.flatten!
to_lex = args.pop
context, body = if to_lex.is_a? Hash
- 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"