rubyjedi/soap4r

View on GitHub

Showing 338 of 416 total issues

Method stubobj2soap_elements has a Cognitive Complexity of 27 (exceeds 5 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 3 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

File factory.rb has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module SOAP
module Mapping


class Factory
Severity: Minor
Found in lib/soap/mapping/factory.rb - About 3 hrs to fix

    Method decode_tag has a Cognitive Complexity of 25 (exceeds 5 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 3 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 rubytypestruct2obj has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

      def rubytypestruct2obj(node, info, map, rubytype)
        klass = rubytype ? Mapping.class_from_name(rubytype) : nil
        obj = nil
        case node.type
        when TYPE_HASH
    Severity: Minor
    Found in lib/soap/mapping/rubytypeFactory.rb - About 3 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 decode_tag has a Cognitive Complexity of 24 (exceeds 5 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 3 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 encode_data has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

      def encode_data(generator, ns, data, parent)
        attrs = {}
        name = generator.encode_name(ns, data, attrs)
        if data.type and data.type.name and
            (@generate_explicit_type or data.force_typed)
    Severity: Minor
    Found in lib/soap/encodingstyle/literalHandler.rb - About 3 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 dump has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      def dump
        buf = ""
        unless @requirepath.empty?
          buf << dump_requirepath 
        end
    Severity: Minor
    Found in lib/xsd/codegen/moduledef.rb - About 3 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

    Class Driver has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Driver
      include AttrProxy
    
      attr_proxy :endpoint_url, true
      attr_proxy :mapping_registry, true
    Severity: Minor
    Found in lib/soap/rpc/driver.rb - About 3 hrs to fix

      File element.rb has 297 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'soap/baseData'
      require 'soap/rpc/methodDef'
      
      
      module SOAP
      Severity: Minor
      Found in lib/soap/rpc/element.rb - About 3 hrs to fix

        Method parse_attr has a Cognitive Complexity of 22 (exceeds 5 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 3 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

        Class SOAPHandler has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class SOAPHandler < Handler
          Namespace = SOAP::EncodingNamespace
          add_handler
        
          def initialize(charset = nil)
        Severity: Minor
        Found in lib/soap/encodingstyle/soapHandler.rb - About 2 hrs to fix

          Method dump has a Cognitive Complexity of 20 (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/literalMappingRegistryCreator.rb - About 2 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 decode_tag_by_wsdl has a Cognitive Complexity of 20 (exceeds 5 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 2 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 encode_data has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def encode_data(generator, ns, data, parent)
              attrs = {}
              name = generator.encode_name(ns, data, attrs)
              if data.type and data.type.name and
                  (@generate_explicit_type or data.force_typed)
          Severity: Major
          Found in lib/soap/encodingstyle/literalHandler.rb - About 2 hrs to fix

            Class Proxy has 24 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Proxy
              include SOAP
            
            public
            
            
            Severity: Minor
            Found in lib/soap/rpc/proxy.rb - About 2 hrs to fix

              Method set_attributes has a Cognitive Complexity of 19 (exceeds 5 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 2 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 parse_schema_element_definition has a Cognitive Complexity of 19 (exceeds 5 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 2 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 unknownstubobj2soap has a Cognitive Complexity of 19 (exceeds 5 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 2 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 dump_method_signatures has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                def dump_method_signatures(servicename = nil, portname = nil)
                  targetservice = XSD::QName.new(@wsdl.targetnamespace, servicename) if servicename
                  targetport = XSD::QName.new(@wsdl.targetnamespace, portname) if portname
                  sig = []
                  element_definitions = @wsdl.collect_elements
              Severity: Minor
              Found in lib/soap/wsdlDriver.rb - About 2 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 parse_elements has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def parse_elements(elements, base_namespace, mpath, opt)
                  schema_element = []
                  any = false
                  elements.each do |element|
                    case element
              Severity: Major
              Found in lib/wsdl/soap/mappingRegistryCreatorSupport.rb - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language