rubyjedi/soap4r

View on GitHub
lib/soap/rpc/element.rb

Summary

Maintainability
B
4 hrs
Test Coverage

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

      def init_param(param)
        mapped_class = SOAPMethod.parse_mapped_class(param.mapped_class)
        qname = param.qname
        if qname.nil? and mapped_class
          qname = TypeMap.respond_to?(:key) ? TypeMap.key(mapped_class) : TypeMap.index(mapped_class) # RubyJedi: compatible with Ruby 1.8.6 and above 
    Severity: Minor
    Found in lib/soap/rpc/element.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 outparams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def outparams
        root = root_node
        if !@is_fault and !root.nil? and !root.is_a?(SOAPBasetype)
          op = root[1..-1]
          op = nil if op && op.empty?
    Severity: Minor
    Found in lib/soap/rpc/element.rb - About 25 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 response has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def response
        root = root_node
        if !@is_fault
          if root.nil?
            nil
    Severity: Minor
    Found in lib/soap/rpc/element.rb - About 25 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

    There are no issues that match your filters.

    Category
    Status