activemerchant/active_merchant

View on GitHub
lib/active_merchant/billing/gateways/iats_payments.rb

Summary

Maintainability
C
1 day
Test Coverage

Class IatsPaymentsGateway has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

    class IatsPaymentsGateway < Gateway
      class_attribute :live_na_url, :live_uk_url

      self.live_na_url = 'https://www.iatspayments.com/NetGate'
      self.live_uk_url = 'https://www.uk.iatspayments.com/NetGate'
Severity: Minor
Found in lib/active_merchant/billing/gateways/iats_payments.rb - About 4 hrs to fix

    File iats_payments.rb has 269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        class IatsPaymentsGateway < Gateway
          class_attribute :live_na_url, :live_uk_url
    
    
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/iats_payments.rb - About 2 hrs to fix

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

            def add_address(post, options)
              billing_address = options[:billing_address] || options[:address]
              if billing_address
                post[:address] = billing_address[:address1]
                post[:city] = billing_address[:city]
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/iats_payments.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 authorization_from has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def authorization_from(action, response)
              if %i[store unstore].include?(action)
                response[:customercode]
              elsif [:purchase_check].include?(action)
                response[:transaction_id] ? "#{response[:transaction_id]}|check" : nil
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/iats_payments.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 recursively_parse_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def recursively_parse_element(node, response)
              if node.has_elements?
                node.elements.each { |n| recursively_parse_element(n, response) }
              else
                response[dexmlize_param_name(node.name)] = (node.text ? node.text.strip : nil)
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/iats_payments.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