rubyjedi/soap4r

View on GitHub

Showing 339 of 417 total issues

Method parse_element has 31 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/definitions.rb - About 1 hr to fix

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

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

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

          def parse_attr(attr, value)
            case attr
            when NamespaceAttrName
              @namespace = value.source
              if @content
        Severity: Minor
        Found in lib/wsdl/import.rb - About 1 hr to fix

          Method add_operation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def add_operation(drv, binding)
              name_creator = WSDL::SOAP::ClassNameCreator.new
              modulepath = 'WSDLDriverFactory'
              methoddefcreator =
                WSDL::SOAP::MethodDefCreator.new(@wsdl, name_creator, modulepath, {})
          Severity: Minor
          Found in lib/soap/wsdlDriver.rb - About 1 hr to fix

            Method fault has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def fault(e, wsdl_fault_details)
                if e.is_a?(UnhandledMustUnderstandHeaderError)
                  faultcode = FaultCode::MustUnderstand
                else
                  faultcode = FaultCode::Server
            Severity: Minor
            Found in lib/soap/rpc/router.rb - About 1 hr to fix

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

                def encode_data(ns, obj, parent)
                  if obj.respond_to?(:to_xmlpart)
                    formatted = trim_eol(obj.to_xmlpart)
                    formatted = trim_indent(formatted)
                    formatted = formatted.gsub(/^/, @indent).sub(/\n+\z/, '')
              Severity: Minor
              Found in lib/soap/generator.rb - About 1 hr to fix

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

                  def parse_attr(attr, value)
                    case attr
                    when NameAttrName
                      @name = XSD::QName.new(targetnamespace, value.source)
                    when RefAttrName
                Severity: Minor
                Found in lib/wsdl/xmlSchema/group.rb - About 1 hr to fix

                  Method unknownstubobj2soap has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def unknownstubobj2soap(obj, definition)
                      return SOAPNil.new if obj.nil?
                      if definition.elements.size == 0
                        ele = Mapping.obj2soap(obj)
                        ele.elename = definition.elename if definition.elename
                  Severity: Minor
                  Found in lib/soap/mapping/encodedregistry.rb - About 1 hr to fix

                    Method _obj2soap has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def _obj2soap(obj, type_qname = nil)
                        ret = nil
                        if obj.is_a?(SOAPCompoundtype)
                          obj.replace do |ele|
                            Mapping._obj2soap(ele, self)
                    Severity: Minor
                    Found in lib/soap/mapping/encodedregistry.rb - About 1 hr to fix

                      Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def initialize(style, use, encodingstyle, op_name, optype_name,
                              headerparts, bodyparts, faultpart, soapaction)
                      Severity: Major
                      Found in lib/wsdl/soap/operation.rb - About 1 hr to fix

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

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

                            def dump_porttype(porttype)
                              assigned_method = collect_assigned_method(@definitions, porttype.name, @modulepath)
                              class_name = mapped_class_basename(porttype.name, @modulepath)
                              c = XSD::CodeGen::ClassDef.new(class_name)
                              element_definitions = @definitions.collect_elements
                          Severity: Minor
                          Found in lib/wsdl/soap/servantSkeltonCreator.rb - About 1 hr to fix

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

                              def parse_element(element)
                                case element
                                when AllName
                                  @content = All.new
                                when SequenceName
                            Severity: Minor
                            Found in lib/wsdl/xmlSchema/complexType.rb - About 1 hr to fix

                              Method unknownstruct2obj has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def unknownstruct2obj(node, info, map)
                                  unless node.type.name
                                    return nil
                                  end
                                  typestr = Mapping.elename2name(node.type.name)
                              Severity: Minor
                              Found in lib/soap/mapping/rubytypeFactory.rb - About 1 hr to fix

                                Method unmarshal has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def unmarshal(conn_data)
                                    xml = nil
                                    opt = {}
                                    contenttype = conn_data.receive_contenttype
                                    if /#{MIMEMessage::MultipartContentType}/i =~ contenttype
                                Severity: Minor
                                Found in lib/soap/rpc/router.rb - About 1 hr to fix

                                  Method valid? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def valid?(value)
                                      return false unless check_restriction(value)
                                      return false unless check_length(value)
                                      return false unless check_maxlength(value)
                                      return false unless check_minlength(value)
                                  Severity: Minor
                                  Found in lib/wsdl/xmlSchema/simpleRestriction.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 unknownstruct2obj has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def unknownstruct2obj(node, info, map)
                                      unless node.type.name
                                        return nil
                                      end
                                      typestr = Mapping.elename2name(node.type.name)
                                  Severity: Minor
                                  Found in lib/soap/mapping/rubytypeFactory.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 dump has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def dump(varname)
                                      @varname = varname
                                      result = ''
                                      str = dump_complextype
                                      unless str.empty?
                                  Severity: Minor
                                  Found in lib/wsdl/soap/encodedMappingRegistryCreator.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 dump has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def dump(porttype = nil)
                                      result = "require 'soap/rpc/driver'\n\n"
                                      if @modulepath
                                        modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above
                                        modulepath.each do |name|
                                  Severity: Minor
                                  Found in lib/wsdl/soap/driverCreator.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