Showing 5 of 9 total issues
Method to_s
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def to_s
date = []
date << "#{@years}Y" unless @years.nil?
date << "#{@months}M" unless @months.nil?
date << "#{@days}D" unless @days.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 open_session
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def open_session(uri, topics, listener_url = nil, xpath_expression = nil, xpath_namespaces = [])
Method open_session
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def open_session(uri, topics, listener_url = nil, xpath_expression = nil, xpath_namespaces = [])
Method to_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
hash = {}
hash[:years] = @years if @years
hash[:months] = @months if @months
hash[:days] = @days if @days
- 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 extract_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_message(response)
# Extract the message element
# e.g. /Envelope/Body/ReadPublicationResponse/PublicationMessage
soap_ns = 'http://schemas.xmlsoap.org/soap/envelope/'
message = response.doc.xpath('s:Envelope/s:Body', s: soap_ns).first.first_element_child.first_element_child
- 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"