activemerchant/active_merchant

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

Summary

Maintainability
B
4 hrs
Test Coverage

Class CardprocessGateway has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

    class CardprocessGateway < Gateway
      self.test_url = 'https://test.vr-pay-ecommerce.de/v1/payments'
      self.live_url = 'https://vr-pay-ecommerce.de/v1/payments'

      self.supported_countries = %w[ BE BG CZ DK DE EE IE ES FR HR IT CY LV LT LU
Severity: Minor
Found in lib/active_merchant/billing/gateways/cardprocess.rb - About 2 hrs to fix

    Method error_code_from has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def error_code_from(response)
            unless success_from(response)
              case response['result']['code']
              when '100.100.101'
                STANDARD_ERROR_CODE[:incorrect_number]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/cardprocess.rb - About 1 hr to fix

      Method hashify_address has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def hashify_address(address)
              hash = {}
              hash[:street1] = address[:address1] if address[:address1]
              hash[:street2] = address[:address2] if address[:address2]
              hash[:city] = address[:city] if address[:city]
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/cardprocess.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