activemerchant/active_merchant

View on GitHub

Showing 999 of 1,496 total issues

Method parse_element has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

      def parse_element(reply, node)
        case node.name
        when 'CrossReferenceTransactionResult'
          reply[:transaction_result] = {}
          node.attributes.each do |a, b|
Severity: Minor
Found in lib/active_merchant/billing/gateways/iridium.rb - About 2 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_3ds has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

      def add_3ds(post, options)
        if options[:three_d_secure]
          post[:three_d_secure] = {}
          if options[:three_d_secure][:enabled]
            post[:three_d_secure][:enabled] = true
Severity: Minor
Found in lib/active_merchant/billing/gateways/pin.rb - About 2 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_address_for_type has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

      def add_address_for_type(type, post, payment, address)
        prefix = address_key_prefix(type)
        first_name, last_name = split_names(address[:name])

        post[address_key(prefix, 'fname')]    = first_name.blank? && last_name.blank? ? payment.first_name : first_name
Severity: Minor
Found in lib/active_merchant/billing/gateways/usa_epay_transaction.rb - About 2 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_address has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

      def add_address(xml, creditcard, options)
        return unless creditcard

        if address = options[:billing_address] || options[:address]
          xml.tag!('CUSTOMER_BILL') do
Severity: Minor
Found in lib/active_merchant/billing/gateways/secure_net.rb - About 2 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_merchant_descriptor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

      def add_merchant_descriptor(xml, options)
        return unless options[:merchant_descriptor] ||
                      options[:user_po] ||
                      options[:taxable] ||
                      options[:reference_data_code] ||
Severity: Minor
Found in lib/active_merchant/billing/gateways/cyber_source.rb - About 2 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

File ebanx.rb has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class EbanxGateway < Gateway
      self.test_url = 'https://sandbox.ebanxpay.com/ws/'
      self.live_url = 'https://api.ebanxpay.com/ws/'
Severity: Minor
Found in lib/active_merchant/billing/gateways/ebanx.rb - About 2 hrs to fix

    File mercury.rb has 287 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        # The Mercury gateway integration by default requires that the Mercury
        # account being used has tokenization turned. This enables the use of
        # capture/refund/void without having to pass the credit card back in each
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/mercury.rb - About 2 hrs to fix

      File pro_pay.rb has 287 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'nokogiri'
      
      module ActiveMerchant #:nodoc:
        module Billing #:nodoc:
          class ProPayGateway < Gateway
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/pro_pay.rb - About 2 hrs to fix

        Class PayexGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class PayexGateway < Gateway
              class_attribute :live_external_url, :test_external_url, :live_confined_url, :test_confined_url
        
              self.live_external_url = 'https://external.payex.com/'
              self.test_external_url = 'https://test-external.payex.com/'
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/payex.rb - About 2 hrs to fix

          Class SecurePayAuGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class SecurePayAuGateway < Gateway
                API_VERSION = 'xml-4.2'
                PERIODIC_API_VERSION = 'spxml-3.0'
          
                class_attribute :test_periodic_url, :live_periodic_url
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/secure_pay_au.rb - About 2 hrs to fix

            Class GarantiGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class GarantiGateway < Gateway
                  self.live_url = 'https://sanalposprov.garanti.com.tr/VPServlet'
                  self.test_url = 'https://sanalposprovtest.garanti.com.tr/VPServlet'
            
                  # The countries the gateway supports merchants from as 2 digit ISO country codes
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/garanti.rb - About 2 hrs to fix

              Class BorgunGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class BorgunGateway < Gateway
                    self.display_name = 'Borgun'
                    self.homepage_url = 'http://www.borgun.com'
              
                    self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/borgun.rb - About 2 hrs to fix

                Class DibsGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class DibsGateway < Gateway
                      self.display_name = 'DIBS'
                      self.homepage_url = 'http://www.dibspayment.com/'
                
                      self.live_url = 'https://api.dibspayment.com/merchant/v1/JSON/Transaction/'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/dibs.rb - About 2 hrs to fix

                  Class PayArcGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class PayArcGateway < Gateway
                        self.test_url = 'https://testapi.payarc.net/v1'
                        self.live_url = 'https://api.payarc.net/v1'
                  
                        self.supported_countries = ['US']
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/pay_arc.rb - About 2 hrs to fix

                    Class DatatransGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class DatatransGateway < Gateway
                          self.test_url = 'https://api.sandbox.datatrans.com/v1/'
                          self.live_url = 'https://api.datatrans.com/v1/'
                    
                          self.supported_countries = %w(CH GR US) # to confirm the countries supported.
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/datatrans.rb - About 2 hrs to fix

                      Class MerchantWareVersionFourGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class MerchantWareVersionFourGateway < Gateway
                            self.live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
                            self.test_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
                      
                            self.supported_countries = ['US']
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/merchant_ware_version_four.rb - About 2 hrs to fix

                        Class MerchantESolutionsGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class MerchantESolutionsGateway < Gateway
                              include Empty
                        
                              self.test_url = 'https://cert.merchante-solutions.com/mes-api/tridentApi'
                              self.live_url = 'https://api.merchante-solutions.com/mes-api/tridentApi'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/merchant_e_solutions.rb - About 2 hrs to fix

                          Class SecureNetGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class SecureNetGateway < Gateway
                                API_VERSION = '4.0'
                          
                                TRANSACTIONS = {
                                  auth_only:            '0000',
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/secure_net.rb - About 2 hrs to fix

                            Class EzicGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class EzicGateway < Gateway
                                  self.live_url = 'https://secure-dm3.ezic.com/gw/sas/direct3.2'
                            
                                  self.supported_countries = %w(AU CA CN FR DE GI IL MT MU MX NL NZ PA PH RU SG KR ES KN GB US)
                                  self.default_currency = 'USD'
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/ezic.rb - About 2 hrs to fix

                              Class MaxipagoGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class MaxipagoGateway < Gateway
                                    API_VERSION = '3.1.1.15'
                              
                                    self.live_url = 'https://api.maxipago.net/UniversalAPI/postXML'
                                    self.test_url = 'https://testapi.maxipago.net/UniversalAPI/postXML'
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/maxipago.rb - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language