Showing 71 of 87 total issues
Class Element
has 60 methods (exceeds 20 allowed). Consider refactoring. Open
class Element < Node
def self.create(*args, &block)
if Document === args.first
document = args.shift
else
Class Node
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
class Node
include Browser::NativeCachedWrapper
ELEMENT_NODE = 1
ATTRIBUTE_NODE = 2
Method supports?
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.supports?(feature)
if defined?(`#@support[#{feature}]`)
return `#@support[#{feature}]`
end
Class Canvas
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Canvas
include Native::Wrapper
attr_reader :element, :style, :text
File element.rb
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Browser; module DOM
class Element < Node
def self.create(*args, &block)
if Document === args.first
Method send
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def send(parameters = @parameters)
raise 'the request has not been opened' unless opened?
raise 'the request has already been sent' if sent?
- 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 node.rb
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Browser; module DOM
# Abstract class for all DOM node types.
#
# @see https://developer.mozilla.org/en-US/docs/Web/API/Node
Class Request
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Request
include Native::Wrapper
include Event::Target
# Default headers.
File base.rb
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Browser
class Event
include Native::Wrapper
Class Event
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Event
include Native::Wrapper
# @see https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
class Definition
Method open
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def open(method = nil, url = nil, asynchronous = nil, user = nil, password = nil)
raise 'the request has already been opened' if opened?
@method = method unless method.nil?
@url = url unless url.nil?
- 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
Class Mouse
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Mouse < UI
handles 'click', 'contextmenu', 'dblclick', 'mousedown', 'mouseenter',
'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup',
'show'
Class Event
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Event
def self.aliases
@aliases ||= {
'dom:load' => 'DOMContentLoaded',
'hover' => 'mouse:over'
Class Document
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Document < Element
include DocumentOrShadowRoot
# Get the first element matching the given ID, CSS selector or XPath.
#
Class Storage
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Storage
def self.json_create(data)
data.delete(JSON.create_id)
Hash[data.map {|key, value|
Method DOM
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def DOM(*args, &block)
if block
document = args.shift || $document
roots = Browser::DOM::Builder.new(document, &block).to_a
- 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 create
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.create(*args, &block)
if Document === args.first
document = args.shift
else
document = $document
- 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 send
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send(parameters = @parameters)
raise 'the request has not been opened' unless opened?
raise 'the request has already been sent' if sent?
Method create_element
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create_element(name, builder=nil, **options, &block)
opts = {}
if options[:is] ||= (options.dig(:attrs, :is))
opts[:is] = options[:is]
- 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 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"