rubyjedi/soap4r

View on GitHub

Showing 338 of 416 total issues

Method parse_attr has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def parse_attr(attr, value)
    case attr
    when NameAttrName
      # namespace may be nil
      if directelement? or elementform == 'qualified'
Severity: Minor
Found in lib/wsdl/xmlSchema/element.rb - About 1 hr to fix

    Method encode_attrs has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def encode_attrs(generator, ns, data, parent)
        attrs = {}
        return attrs if data.is_a?(SOAPReference)
    
        if !parent || parent.encodingstyle != EncodingNamespace
    Severity: Minor
    Found in lib/soap/encodingstyle/soapHandler.rb - About 1 hr to fix

      Method dump_element has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def dump_element
          @elements.collect { |ele|
            # has the definition different from the complexType of the same name
            next if ele.type.nil? and @complextypes[ele.name]
            dump_with_inner {
      Severity: Minor
      Found in lib/wsdl/soap/literalMappingRegistryCreator.rb - About 1 hr 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 assign_const has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def assign_const(value, prefix = '')
          return if value.nil? or @defined_const.key?(value)
          name = value.scan(/[^:\/]+\/?\z/)[0] || 'C'
          tag = prefix + safeconstname(name)
          if @defined_const.value?(tag)
      Severity: Minor
      Found in lib/wsdl/soap/classDefCreatorSupport.rb - About 1 hr 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 check_type has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def check_type
          if have_any?
            :TYPE_STRUCT
          elsif content
            if attributes.empty? and map_as_array?
      Severity: Minor
      Found in lib/wsdl/soap/complexType.rb - About 1 hr 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 add_attributes2stubobj has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def add_attributes2stubobj(node, obj, definition)
          return if obj.nil? or node.extraattr.empty?
          if attributes = definition.attributes
            define_xmlattr(obj)
            attributes.each do |qname, class_name|
      Severity: Minor
      Found in lib/soap/mapping/literalregistry.rb - About 1 hr 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 parse_opt has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def parse_opt(getoptlong)
          opt = {}
          wsdl = nil
          begin
            getoptlong.each do |name, arg|
      Severity: Minor
      Found in bin/wsdl2ruby.rb - About 1 hr to fix

        Method stubobj2soap_elements has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def stubobj2soap_elements(obj, ele, definition, is_choice = false)
            added = false
            case definition
            when SchemaSequenceDefinition, SchemaEmptyDefinition
              definition.each do |eledef|
        Severity: Minor
        Found in lib/soap/mapping/literalregistry.rb - About 1 hr to fix

          Method call has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def call(name, *params)
              # name must be used only for lookup
              op_info = lookup_operation(name)
              mapping_opt = create_mapping_opt
              req_header = create_request_header
          Severity: Minor
          Found in lib/soap/rpc/proxy.rb - About 1 hr to fix

            Method decode_tag has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def decode_tag(ns, name, attrs, parent)
                o = nil
                elename = ns.parse(name)
                if !parent
                  if elename == SchemaName
            Severity: Minor
            Found in lib/wsdl/xmlSchema/parser.rb - About 1 hr to fix

              Method dump has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def dump
                  buf = ""
                  unless @requirepath.empty?
                    buf << dump_requirepath 
                  end
              Severity: Minor
              Found in lib/xsd/codegen/classdef.rb - About 1 hr to fix

                Method decode_tag_by_wsdl has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, attrs)
                    o = nil
                    if parent.class == SOAPBody
                      # root element: should branch by root attribute?
                      if @is_first_top_ele
                Severity: Minor
                Found in lib/soap/encodingstyle/soapHandler.rb - About 1 hr to fix

                  Method init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def Charset.init
                      EncodingConvertMap[['UTF8', 'X_ISO_8859_1']] =
                        Proc.new { |str| str.unpack('U*').pack('C*') }
                      EncodingConvertMap[['X_ISO_8859_1', 'UTF8']] =
                        Proc.new { |str| str.unpack('C*').pack('U*') }
                  Severity: Minor
                  Found in lib/xsd/charset.rb - About 1 hr to fix

                    Method decode_tag has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def decode_tag(ns, name, attrs, parent)
                        o = nil
                        elename = ns.parse(name)
                        if !parent
                          if elename == DefinitionsName
                    Severity: Minor
                    Found in lib/wsdl/parser.rb - About 1 hr to fix

                      Method dump_inout_type has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def dump_inout_type(param, element_definitions)
                          if param
                            message = param.find_message
                            params = ""
                            message.parts.each do |part|
                      Severity: Minor
                      Found in lib/wsdl/soap/classDefCreatorSupport.rb - About 1 hr 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 complexobj2soapchildren_array has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def complexobj2soapchildren_array(obj, soap, child_ele, nillable)
                          child = Mapping.get_attribute(obj, child_ele.name.name)
                          if child.nil? and obj.is_a?(::Array)
                            child = obj
                          end
                      Severity: Minor
                      Found in lib/soap/mapping/wsdlliteralregistry.rb - About 1 hr 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 unmarshal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def unmarshal(conn_data, opt)
                          contenttype = conn_data.receive_contenttype
                          xml = nil
                          if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
                            opt[:external_content] = {}
                      Severity: Minor
                      Found in lib/soap/rpc/proxy.rb - About 1 hr 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 fault2exception has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def self.fault2exception(fault, registry = nil)
                          registry ||= Mapping::DefaultRegistry
                          detail = ""
                          if fault.detail
                            begin
                      Severity: Minor
                      Found in lib/soap/mapping/mapping.rb - About 1 hr 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 post_redirect has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def post_redirect(url, req_body, header, redirect_count)
                          if str = @test_loopback_response.shift
                            if @debug_dev
                              @debug_dev << "= Request\n\n"
                              @debug_dev << req_body
                      Severity: Minor
                      Found in lib/soap/netHttpClient.rb - About 1 hr 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 initialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil)
                          super(EleFaultName)
                          @elename = EleFaultName
                          @encodingstyle = EncodingNamespace
                          if faultcode
                      Severity: Minor
                      Found in lib/soap/element.rb - About 1 hr 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

                      Severity
                      Category
                      Status
                      Source
                      Language