Method _render_soap
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def _render_soap(result, options)
@namespace = soap_config.namespace
@operation = soap_action = request.env['wash_out.soap_action']
@action_spec = self.class.soap_actions[soap_action]
- 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 _render_soap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _render_soap(result, options)
@namespace = soap_config.namespace
@operation = soap_action = request.env['wash_out.soap_action']
@action_spec = self.class.soap_actions[soap_action]
Method _strip_empty_nodes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _strip_empty_nodes(params, hash)
hash.keys.each do |key|
param = params.detect { |a| a.raw_name.to_s == key.to_s }
next if !(param && hash[key].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"
Further reading
Method deep_replace_href
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.deep_replace_href(element, replace)
return element unless element.is_a?(Array) || element.is_a?(Hash)
if element.is_a?(Array) # Traverse arrays
return element.map{|x| deep_replace_href(x, replace)}
- 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 deep_select
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.deep_select(collection, result=[], &blk)
values = collection.respond_to?(:values) ? collection.values : collection
result += values.select(&blk)
values.each do |value|
- 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"