Method end_namespaced_element
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def end_namespaced_element(name)
if @stack.empty?
@delegated_document.__setobj__(@original_document)
@original_document.end_namespaced_element(name)
return
- 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 start_namespaced_element
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def start_namespaced_element(name, attrs = {})
@data = ""
deserialize_as_localized_method_fault = true
if @stack.empty?
if @is_fault
- 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 end_namespaced_element
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_namespaced_element(name)
if @stack.empty?
@delegated_document.__setobj__(@original_document)
@original_document.end_namespaced_element(name)
return
File deserializer.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
module VimSdk
module Soap
class DelegatedDocument < DelegateClass(Nokogiri::XML::SAX::Document)
Method start_namespaced_element
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_namespaced_element(name, attrs = {})
@data = ""
deserialize_as_localized_method_fault = true
if @stack.empty?
if @is_fault
Method lookup_wsdl_type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def lookup_wsdl_type(namespace, name, allow_managed_object_reference = false)
begin
return VmomiSupport.loaded_wsdl_type(namespace, name)
rescue
if allow_managed_object_reference
- 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
Avoid deeply nested control flow statements. Open
if ancestor_set.include?(Vmodl::ManagedObject)
object = object.new(@data, @stub)
elsif object.ancestors.include?(SoapEnum)
object = object.const_get(VmodlHelper.underscore(@data).upcase)
elsif object == SoapFloat || object == SoapDouble
Method start_element_namespace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])