rubyjedi/soap4r

View on GitHub

Showing 338 of 416 total issues

Method run has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run
    res = WEBrick::HTTPResponse.new({:HTTPVersion => HTTPVersion, :Logger => logger})
    begin
      @log.info { "received a request from '#{ @remote_host }'" }
      if @fcgi
Severity: Minor
Found in lib/soap/rpc/cgistub.rb - About 1 hr to fix

    Method set_options has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def set_options(client, options)
        client.proxy = options["proxy"]
        options.add_hook("proxy") do |key, value|
          client.proxy = value
        end
    Severity: Minor
    Found in lib/soap/httpconfigloader.rb - About 1 hr to fix

      Method parse_element has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def parse_element(element)
          case element
          when LengthName
            Length.new
          when MinLengthName
      Severity: Minor
      Found in lib/wsdl/xmlSchema/simpleRestriction.rb - About 1 hr to fix

        Method encode_data has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def encode_data(generator, ns, data, parent)
            attrs = encode_attrs(generator, ns, data, parent)
            if parent && parent.is_a?(SOAPArray) && parent.position
              attrs[ns.name(AttrPositionName)] = "[#{parent.position.join(',')}]"
            end
        Severity: Minor
        Found in lib/soap/encodingstyle/soapHandler.rb - About 1 hr to fix

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

            def dump(type = nil)
              result = "require 'xsd/qname'\n"
              # cannot use @modulepath because of multiple classes
              if @modulepath
                result << "\n"
          Severity: Minor
          Found in lib/wsdl/soap/classDefCreator.rb - About 1 hr to fix

            Method parse_element has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def parse_element(element)
                case element
                when ImportName
                  o = Import.new
                  @imports << o
            Severity: Minor
            Found in lib/wsdl/xmlSchema/schema.rb - About 1 hr to fix

              Method initialize has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def initialize(soapaction, param_def, opt)
                    @soapaction = soapaction
                    @request_style = opt[:request_style]
                    @response_style = opt[:response_style]
                    @request_use = opt[:request_use]
              Severity: Minor
              Found in lib/soap/rpc/proxy.rb - About 1 hr to fix

                Method post_redirect has 37 lines of code (exceeds 25 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

                  Method create_structdef has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def create_structdef(mpath, qname, typedef, qualified = false)
                      classname = mapped_class_basename(qname, mpath)
                      baseclassname = nil
                      if typedef.complexcontent
                        if base = typedef.complexcontent.base
                  Severity: Minor
                  Found in lib/wsdl/soap/classDefCreator.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 fetch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def fetch(location)
                      warn("importing: #{location}") if $DEBUG
                      content = nil
                      normalizedlocation = location
                      if location.scheme == 'file' or
                  Severity: Minor
                  Found in lib/wsdl/xmlSchema/importer.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 decode_tag has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def decode_tag(ns, elename, attrs, parent)
                      @textbuf.clear
                      is_nil, type, arytype, root, offset, position, href, id =
                        extract_attrs(ns, attrs)
                      o = nil
                  Severity: Minor
                  Found in lib/soap/encodingstyle/soapHandler.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 collect_fault_messages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def collect_fault_messages
                      result = []
                      porttypes.each do |porttype|
                        port_binding = porttype.find_binding()
                        next unless port_binding
                  Severity: Minor
                  Found in lib/wsdl/soap/definitions.rb - About 1 hr to fix

                    Method decode_parent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def decode_parent(parent, node)
                        case parent.node
                        when SOAPUnknown
                          newparent = parent.node.as_struct
                          node.parent = newparent
                    Severity: Minor
                    Found in lib/soap/encodingstyle/aspDotNetHandler.rb - About 1 hr to fix

                      Method set_ssl_config has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def set_ssl_config(client, ssl_config)
                          ssl_config.each do |key, value|
                            cfg = client.ssl_config
                            if cfg.nil?
                              raise NotImplementedError.new("SSL not supported")
                      Severity: Minor
                      Found in lib/soap/httpconfigloader.rb - About 1 hr to fix

                        Method parse_schema_element_definition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def self.parse_schema_element_definition(schema_element, default_ns)
                            if schema_element[0] == :choice
                              parse_schema_definition(schema_element, default_ns)
                            elsif schema_element[0].is_a?(Array)
                              parse_schema_definition(schema_element, default_ns)
                        Severity: Minor
                        Found in lib/soap/mapping/mapping.rb - About 1 hr to fix

                          Method dump has 33 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/moduledef.rb - About 1 hr to fix

                            Method dump_porttype has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def dump_porttype(porttype)
                                class_name = mapped_class_name(porttype.name, @modulepath)
                                defined_const = {}
                                methoddef = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name)
                                wsdl_name = @definitions.name ? @definitions.name.name : 'default'
                            Severity: Minor
                            Found in lib/wsdl/soap/cgiStubCreator.rb - About 1 hr to fix

                              Method _soap2obj has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def _soap2obj(node, klass = nil)
                                  definition = find_node_definition(node)
                                  if klass
                                    klass_definition = schema_definition_from_class(klass)
                                    if definition and (definition.class_for < klass)
                              Severity: Minor
                              Found in lib/soap/mapping/encodedregistry.rb - About 1 hr to fix

                                Method set_attributes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def self.set_attributes(obj, values)
                                    case obj
                                    when ::SOAP::Mapping::Object
                                      values.each do |attr_name, value|
                                        obj.__add_xmlele_value(attr_name, value)
                                Severity: Minor
                                Found in lib/soap/mapping/mapping.rb - About 1 hr to fix

                                  Method route has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def route(conn_data)
                                      # we cannot set request_default_encodingsyle before parsing the content.
                                      env = unmarshal(conn_data)
                                      if env.nil?
                                        raise ArgumentError.new("illegal SOAP marshal format")
                                  Severity: Minor
                                  Found in lib/soap/rpc/router.rb - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language