Showing 71 of 87 total issues
Method off
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def off(what = nil)
case what
when Callback
callbacks.delete(what)
detach(what)
- 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 initialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
if DOM::Element === args.first
element = args.shift
if DOM::Element::Image === element
- 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
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def on(name, selector = nil, &block)
raise ArgumentError, 'no block has been given' unless block
name = Event.name_for(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 shake
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shake(dir)
grid = @grid
conversion = proc {}
back_conversion = nil
Method DOM
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DOM(*args, &block)
if block
document = args.shift || $document
roots = Browser::DOM::Builder.new(document, &block).to_a
Method initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(*args)
if DOM::Element === args.first
element = args.shift
if DOM::Element::Image === element
Method create_element
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_element(name, builder=nil, **options, &block)
opts = {}
if options[:is] ||= (options.dig(:attrs, :is))
opts[:is] = options[:is]
Method off
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def off(what = nil)
case what
when Callback
callbacks.delete(what)
detach(what)
Method on
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on(name, selector = nil, &block)
raise ArgumentError, 'no block has been given' unless block
name = Event.name_for(name)
Method unflatten
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def unflatten(array)
out = {}
array.each do |k,v|
path = [k.split("[").first] + k.scan(/\[(.*?)\]/).flatten
c = out
- 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 convert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def convert(hash)
options = Native(`{}`)
if hash[:children]
options[:childList] = true
- 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 []=
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def []=(name, value, options = {})
if namespace = options[:namespace] || @namespace
if value
`#@native.setAttributeNS(#{namespace.to_s}, #{name.to_s}, #{value})`
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 transform
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def transform(m11, m12, m21, m22, dx, dy, &block)
Method ready
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ready(&block)
raise ArgumentError, 'no block given' unless block
return block.call if ready?
- 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 new
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.new(*args, &block)
if args.length == 1 && !block_given? && Opal.native?(args[0])
# Use `.new` as a wrapping method.
node = args[0]
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 []
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def [](name, options = {})
if name == :class && Browser.supports?('Element.className')
name = :className
elsif name == :for && Browser.supports?('Element.htmlFor')
name = :htmlFor
- 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 supports?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.supports?(feature)
if defined?(`#@support[#{feature}]`)
return `#@support[#{feature}]`
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 bezier_curve_to
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bezier_curve_to(cp1x, cp1y, cp2x, cp2y, x, y)
Method draw_line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_line(c, x1, y1, x2, y2)
Method open
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def open(method = nil, url = nil, asynchronous = nil, user = nil, password = nil)