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
Class Request
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Request
include Native::Wrapper
include Event::Target
# Default headers.
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
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 open
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def open(method = nil, url = nil, asynchronous = nil, user = nil, password = nil)
Method callback
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def callback
-> event {
state = STATES[`#@native.readyState`]
res = response
- 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"