savonrb/wasabi

View on GitHub

Showing 9 of 11 total issues

Method input_output_for has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def input_output_for(operation, input_output)
      operation_name = operation['name']

      # Look up the input by walking up to portType, then up to the message.

Severity: Minor
Found in lib/wasabi/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

Class Parser has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Parser

    XSD      = 'http://www.w3.org/2001/XMLSchema'
    WSDL     = 'http://schemas.xmlsoap.org/wsdl/'
    SOAP_1_1 = 'http://schemas.xmlsoap.org/wsdl/soap/'
Severity: Minor
Found in lib/wasabi/parser.rb - About 2 hrs to fix

    Class Document has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Document
    
        ELEMENT_FORM_DEFAULTS = [:unqualified, :qualified]
    
        # Validates if a given +value+ is a valid elementFormDefault value.
    Severity: Minor
    Found in lib/wasabi/document.rb - About 2 hrs to fix

      Method input_output_for has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def input_output_for(operation, input_output)
            operation_name = operation['name']
      
            # Look up the input by walking up to portType, then up to the message.
      
      
      Severity: Minor
      Found in lib/wasabi/parser.rb - About 1 hr to fix

        Method process_type has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def process_type(namespace, type, name)
              @types[name] ||= { :namespace => namespace }
              @types[name][:order!] = []
        
              type.xpath('./xs:sequence/xs:element', 'xs' => XSD).each do |inner|
        Severity: Minor
        Found in lib/wasabi/parser.rb - About 1 hr to fix

          Method process_type has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def process_type(namespace, type, name)
                @types[name] ||= { :namespace => namespace }
                @types[name][:order!] = []
          
                type.xpath('./xs:sequence/xs:element', 'xs' => XSD).each do |inner|
          Severity: Minor
          Found in lib/wasabi/parser.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 parse_operations has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse_operations
                operations = document.xpath('wsdl:definitions/wsdl:binding/wsdl:operation', 'wsdl' => WSDL)
                operations.each do |operation|
                  name = operation.attribute('name').to_s
                  snakecase_name = Wasabi::CoreExt::String.snakecase(name).to_sym
          Severity: Minor
          Found in lib/wasabi/parser.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 parse_types has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse_types
                schemas.each do |schema|
                  schema_namespace = schema['targetNamespace']
          
                  schema.element_children.each do |node|
          Severity: Minor
          Found in lib/wasabi/parser.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 parse_operations_parameters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse_operations_parameters
                 document.xpath("wsdl:definitions/wsdl:types/*[local-name()='schema']/*[local-name()='element']", 'wsdl' => WSDL).each do |element|
                  name = Wasabi::CoreExt::String.snakecase(element.attribute('name').to_s).to_sym
          
                  if operation = @operations[name]
          Severity: Minor
          Found in lib/wasabi/parser.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