rubyjedi/soap4r

View on GitHub

Showing 339 of 417 total issues

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

  def screen_data_str(str)
    /^([+\-]?)(\d*)(?:\.(\d*)?)?$/ =~ str.to_s.strip
    unless Regexp.last_match
      raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.")
    end
Severity: Minor
Found in lib/xsd/datatypes.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_element has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def dump_element(target = nil)
    @elements.collect { |ele|
      next if @complextypes[ele.name]
      next if target and target != ele.name
      c = create_elementdef(@modulepath, ele)
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 dump_attributes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def dump_attributes
    str = ""
    @attrdef.each do |attrname, writable, varname|
      varname ||= attrname
      if attrname == varname
Severity: Minor
Found in lib/xsd/codegen/classdef.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

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 = ""
    if @modulepath
      result << "\n"
      modulepath = @modulepath.respond_to?(:lines) ? @modulepath.lines : @modulepath # RubyJedi: compatible with Ruby 1.8.6 and above      
Severity: Minor
Found in lib/wsdl/soap/servantSkeltonCreator.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 find_operation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def find_operation
    porttype.operations.each do |op|
      next if op.name != @name
      next if op.input and @input and op.input.name and @input.name and
        op.input.name != @input.name
Severity: Minor
Found in lib/wsdl/operationBinding.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 stubobj2soap has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def stubobj2soap(obj, qname, definition)
    if obj.nil?
      ele = SOAPNil.new
      ele.elename = qname
    elsif obj.is_a?(::String)
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 call has a Cognitive Complexity of 10 (exceeds 5 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

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 10 (exceeds 5 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

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 any2obj has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def any2obj(node, obj_class = nil)
    is_compound = node.is_a?(::SOAP::SOAPCompoundtype)
    # trust xsi:type first
    if is_compound and node.type
      definition = schema_definition_from_type(node.type)
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 complexobj2sequencesoap has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def complexobj2sequencesoap(obj, soap, type, nillable, is_choice)
    added = false
    type.elements.each do |child_ele|
      case child_ele
      when WSDL::XMLSchema::Any
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 find_port has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def find_port(servicename = nil, portname = nil)
    service = port = nil
    if servicename
      service = @wsdl.service(
        XSD::QName.new(@wsdl.targetnamespace, servicename))
Severity: Minor
Found in lib/soap/wsdlDriver.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 []= has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def []=(*idxary)
    value = idxary.slice!(-1)
    if idxary.size != @rank
      raise ArgumentError.new("given #{idxary.size} params(#{idxary}) does not match rank: #{@rank}")
    end
Severity: Minor
Found in lib/soap/baseData.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 encode_data has a Cognitive Complexity of 10 (exceeds 5 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

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 create_array_element_definition has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_array_element_definition(typedef, mpath)
    child_type = typedef.child_type
    child_element = typedef.find_aryelement
    if child_type == XSD::AnyTypeName
      type = nil
Severity: Minor
Found in lib/wsdl/soap/mappingRegistryCreatorSupport.rb - About 1 hr to fix

    Method decode_defined_complextype has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def decode_defined_complextype(elename, typename, typedef, arytypestr)
        case typedef.compoundtype
        when :TYPE_STRUCT, :TYPE_MAP
          o = SOAPStruct.decode(elename, typename)
          o.definedtype = typedef
    Severity: Minor
    Found in lib/soap/encodingstyle/soapHandler.rb - About 1 hr to fix

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

        Method define_attribute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def define_attribute(c, attributes)
            const = {}
            unless attributes.empty?
              c.def_method("__xmlattr") do <<-__EOD__
                  @__xmlattr ||= {}
        Severity: Minor
        Found in lib/wsdl/soap/classDefCreator.rb - About 1 hr to fix

          Method do_POST has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def do_POST(req, res)
              logger.debug { "SOAP request: " + req.body } if logger
              if @authenticator
                @authenticator.authenticate(req, res)
                # you can check authenticated user with SOAP::RPC::SOAPlet.user
          Severity: Minor
          Found in lib/soap/rpc/soaplet.rb - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language