rubyjedi/soap4r

View on GitHub

Showing 339 of 417 total issues

Method create_connection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def create_connection(url)
    proxy_host = proxy_port = nil
    unless no_proxy?(url)
      proxy_host = @proxy.host
      proxy_port = @proxy.port
Severity: Minor
Found in lib/soap/netHttpClient.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

Method load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def load(stream)
    key_prefix = ""
    if stream.respond_to?(:each_line) # Ruby 1.9 and beyond
      stream = stream.each_line      
    elsif stream.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6
Severity: Minor
Found in lib/soap/property.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

Method offsetnext has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def offsetnext
    move = false
    idx = @offset.size - 1
    while !move && idx >= 0
      @offset[idx] += 1
Severity: Minor
Found in lib/soap/baseData.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

Method to_obj has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def to_obj
    if !have_member
      @text
    else
      hash = {}
Severity: Minor
Found in lib/soap/baseData.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

Method encode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def encode(generator, ns, attrs = {})
    attrs.each do |key, value|
      @element.extraattr[key] = value
    end
    # to remove mustUnderstand attribute, set it to nil
Severity: Minor
Found in lib/soap/element.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

Method soap2array has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def soap2array(ary)
    traverse_data(@data) do |v, *position|
      iteary = ary
      rank = 1
      while rank < position.size
Severity: Minor
Found in lib/soap/baseData.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

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

  def initialize(varname, mapped_class, elename, minoccurs, maxoccurs,
      as_any, as_array)
Severity: Major
Found in lib/soap/mapping/schemadefinition.rb - About 50 mins to fix

    Method rpc_operation_complextypes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def rpc_operation_complextypes(binding)
        types = XSD::NamedElements.new
        binding.operations.each do |op_bind|
          if op_bind_rpc?(op_bind)
        operation = op_bind.find_operation
    Severity: Minor
    Found in lib/wsdl/soap/definitions.rb - About 45 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

    Method locations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def locations
        binding = find_binding
        return [] if binding.nil?
        bind_name = binding.name
        result = []
    Severity: Minor
    Found in lib/wsdl/portType.rb - About 45 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

    Method trim_indent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def trim_indent(str)
        indent = nil
        str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
        str = str.collect { |line| untab(line) }.join
        str = str.lines if str.respond_to?(:lines) # RubyJedi: compatible with Ruby 1.8.6 and above
    Severity: Minor
    Found in lib/xsd/codegen/gensupport.rb - About 45 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

    Method rpcdefinedtype has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def rpcdefinedtype(part)
        if mapped = basetype_mapped_class(part.type)
          return ['::' + mapped.name, nil]
        elsif definedtype = @simpletypes[part.type]
          return [nil, definedtype.name]
    Severity: Minor
    Found in lib/wsdl/soap/methodDefCreator.rb - About 45 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

    Method documentdefinedtype has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def documentdefinedtype(part)
        if mapped = basetype_mapped_class(part.type)
          return ['::' + mapped.name, XSD::QName.new(nil, part.name)]
        elsif definedtype = @simpletypes[part.type]
          if definedtype.base
    Severity: Minor
    Found in lib/wsdl/soap/methodDefCreator.rb - About 45 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

    Method define_dump_class has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def define_dump_class(var, mpath, qname, typedef, as_element, opt)
    Severity: Minor
    Found in lib/wsdl/soap/mappingRegistryCreatorSupport.rb - About 45 mins to fix

      Method rubytype2obj has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def rubytype2obj(node, info, map, rubytype)
          klass = rubytype ? Mapping.class_from_name(rubytype) : nil
          obj = nil
          case node
          when SOAPString
      Severity: Minor
      Found in lib/soap/mapping/rubytypeFactory.rb - About 45 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

      Method attributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def attributes
          attrs = nil
          if @complexcontent
            attrs = @complexcontent.attributes + @attributes
          elsif @simplecontent
      Severity: Minor
      Found in lib/wsdl/xmlSchema/complexType.rb - About 45 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 parent.node.is_a?(SOAPBody)
              o = SOAPFault.new
              parent.node.fault = o
            elsif parent.node.is_a?(SOAPEnvelope)
              # live.com server returns SOAPFault as a direct child of SOAPEnvelope.
      Severity: Major
      Found in lib/soap/parser.rb - About 45 mins to fix

        Method elesoapchild2obj has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def elesoapchild2obj(value, eledef)
            if eledef.mapped_class
              if eledef.mapped_class.include?(::SOAP::SOAPBasetype)
                base2obj(value, eledef.mapped_class)
              else
        Severity: Minor
        Found in lib/soap/mapping/literalregistry.rb - About 45 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

        Method obj2soap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def obj2soap(obj, qname, obj_class = nil)
            soap_obj = nil
            if obj.is_a?(SOAPElement)
              soap_obj = obj
            elsif eledef = @definedelements[qname]
        Severity: Minor
        Found in lib/soap/mapping/wsdlliteralregistry.rb - About 45 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

        Method decode_tag_by_wsdl has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, attrs)
        Severity: Minor
        Found in lib/soap/encodingstyle/soapHandler.rb - About 45 mins to fix

          Method decode_resolve_id has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def decode_resolve_id
              count = @refpool.length    # To avoid infinite loop
              while !@refpool.empty? && count > 0
                @refpool = @refpool.find_all { |ref|
              o = @idpool.find { |item|
          Severity: Minor
          Found in lib/soap/encodingstyle/soapHandler.rb - About 45 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

          Severity
          Category
          Status
          Source
          Language