cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub
bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb

Summary

Maintainability
D
2 days
Test Coverage

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
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 6 hrs to fix

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
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 4 hrs to fix

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
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 2 hrs to fix

    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)
    
    
    Severity: Minor
    Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 2 hrs to fix

      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
      Severity: Minor
      Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 1 hr to fix

        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
        Severity: Minor
        Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 55 mins to fix

        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
        Severity: Major
        Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 45 mins to fix

          Method start_element_namespace has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
          Severity: Minor
          Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status