tstmedia/active_zuora

View on GitHub
lib/active_zuora/generator.rb

Summary

Maintainability
C
1 day
Test Coverage

Method add_extra_customizations has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def add_extra_customizations
      # We can't know everything from the wsdl, like which fields are
      # usable in queries.  This function does some final customizations
      # based on the existing Zuora documentation.
      # Also, it's possible classes customized here weren't defined
Severity: Minor
Found in lib/active_zuora/generator.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 add_extra_customizations has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def add_extra_customizations
      # We can't know everything from the wsdl, like which fields are
      # usable in queries.  This function does some final customizations
      # based on the existing Zuora documentation.
      # Also, it's possible classes customized here weren't defined
Severity: Major
Found in lib/active_zuora/generator.rb - About 2 hrs to fix

    Method generate_classes has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def generate_classes
    
          # Defines the classes based on the wsdl document.
          # Assumes the following namespaces in the wsdl.
          # xmlns="http://schemas.xmlsoap.org/wsdl/"
    Severity: Minor
    Found in lib/active_zuora/generator.rb - About 1 hr to fix

      Method add_obvious_associations has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def add_obvious_associations
            # When a zuora class has a field called InvoiceId, it's a safe
            # assuption that it references the an Invoice.
            # Build those associations automatically.
            @classes.each do |zuora_class|
      Severity: Minor
      Found in lib/active_zuora/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 generate_classes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_classes
      
            # Defines the classes based on the wsdl document.
            # Assumes the following namespaces in the wsdl.
            # xmlns="http://schemas.xmlsoap.org/wsdl/"
      Severity: Minor
      Found in lib/active_zuora/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

      There are no issues that match your filters.

      Category
      Status