activemerchant/active_merchant

View on GitHub

Showing 1,463 of 1,463 total issues

Class ElementGateway has 36 methods (exceeds 20 allowed). Consider refactoring.
Open

    class ElementGateway < Gateway
      self.test_url = 'https://certtransaction.elementexpress.com/express.asmx'
      self.live_url = 'https://transaction.elementexpress.com/express.asmx'

      self.supported_countries = ['US']
Severity: Minor
Found in lib/active_merchant/billing/gateways/element.rb - About 4 hrs to fix

    Method add_level_two_data has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_level_two_data(doc, payment_method, options = {})
            level_2_data = options[:level_2_data]
            if level_2_data
              doc.enhancedData do
                case payment_method.brand
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/litle.rb - About 4 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_credit_card has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_credit_card(xml, credit_card, address)
            xml.tag! :Card do
              # DataCash calls the CC number 'pan'
              xml.tag! :pan, credit_card.number
              xml.tag! :expirydate, format_date(credit_card.month, credit_card.year)
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/data_cash.rb - About 4 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 PaymentezGateway has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class PaymentezGateway < Gateway #:nodoc:
          self.test_url = 'https://ccapi-stg.paymentez.com/v2/'
          self.live_url = 'https://ccapi.paymentez.com/v2/'
    
          self.supported_countries = %w[MX EC CO BR CL PE]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/paymentez.rb - About 4 hrs to fix

      Class CommerceHubGateway has 35 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class CommerceHubGateway < Gateway
            self.test_url = 'https://cert.api.fiservapps.com/ch'
            self.live_url = 'https://prod.api.fiservapps.com/ch'
      
            self.supported_countries = ['US']
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/commerce_hub.rb - About 4 hrs to fix

        Class JetpayV2Gateway has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class JetpayV2Gateway < Gateway
              self.test_url = 'https://test1.jetpay.com/jetpay'
              self.live_url = 'https://gateway20.jetpay.com/jetpay'
        
              self.money_format = :cents
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/jetpay_v2.rb - About 4 hrs to fix

          Class MundipaggGateway has 35 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class MundipaggGateway < Gateway
                self.live_url = 'https://api.mundipagg.com/core/v1'
          
                self.supported_countries = ['US']
                self.default_currency = 'USD'
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/mundipagg.rb - About 4 hrs to fix

            Method add_auth_wallet has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                  def add_auth_wallet(xml, payment_method, options)
                    commerce_indicator = 'internet' if subsequent_nt_apple_pay_auth(payment_method.source, options)
            
                    brand = card_brand(payment_method).to_sym
            
            
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/cyber_source.rb - About 4 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_auth_service has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                  def add_auth_service(xml, payment_method, options)
                    if network_tokenization?(payment_method)
                      if payment_method.source == :network_token
                        add_auth_network_tokenization(xml, payment_method, options)
                      else
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/cyber_source.rb - About 4 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 redsys_rest.rb has 350 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ActiveMerchant #:nodoc:
              module Billing #:nodoc:
                # = Redsys Merchant Gateway
                #
                # Gateway support for the Spanish "Redsys" payment gateway system. This is
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/redsys_rest.rb - About 4 hrs to fix

              File sage.rb has 350 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module ActiveMerchant #:nodoc:
                module Billing #:nodoc:
                  class SageGateway < Gateway
                    include Empty
              
              
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/sage.rb - About 4 hrs to fix

                File commerce_hub.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module ActiveMerchant #:nodoc:
                  module Billing #:nodoc:
                    class CommerceHubGateway < Gateway
                      self.test_url = 'https://cert.api.fiservapps.com/ch'
                      self.live_url = 'https://prod.api.fiservapps.com/ch'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/commerce_hub.rb - About 4 hrs to fix

                  File latitude19.rb has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      class Latitude19Gateway < Gateway
                        self.display_name = 'Latitude19 Gateway'
                        self.homepage_url = 'http://www.l19tech.com'
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/latitude19.rb - About 4 hrs to fix

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

                        class IveriGateway < Gateway
                          class_attribute :iveri_url
                    
                          self.live_url = self.test_url = 'https://portal.nedsecure.co.za/iVeriWebService/Service.asmx'
                          self.iveri_url = 'https://portal.host.iveri.com/iVeriWebService/Service.asmx'
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/iveri.rb - About 4 hrs to fix

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

                          class Shift4Gateway < Gateway
                            self.test_url = 'https://utgapi.shift4test.com/api/rest/v1/'
                            self.live_url = 'https://utg.shift4api.net/api/rest/v1/'
                      
                            self.supported_countries = %w(US CA CU HT DO PR JM TT GP MQ BS BB LC CW AW VC VI GD AG DM KY KN SX TC MF VG BQ AI BL MS)
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/shift4.rb - About 4 hrs to fix

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

                            class BarclaycardSmartpayGateway < Gateway
                              self.test_url = 'https://pal-test.barclaycardsmartpay.com/pal/servlet'
                              self.live_url = 'https://pal-live.barclaycardsmartpay.com/pal/servlet'
                        
                              self.supported_countries = %w[AL AD AM AT AZ BY BE BA BG HR CY CZ DK EE FI FR DE GR HU IS IE IT KZ LV LI LT LU MK MT MD MC ME NL NO PL PT RO RU SM RS SK SI ES SE CH TR UA GB VA]
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/barclaycard_smartpay.rb - About 4 hrs to fix

                          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

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

                                class DecidirPlusGateway < Gateway
                                  self.test_url = 'https://developers.decidir.com/api/v2'
                                  self.live_url = 'https://live.decidir.com/api/v2'
                            
                                  self.supported_countries = ['AR']
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/decidir_plus.rb - About 4 hrs to fix

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

                                  class DeepstackGateway < Gateway
                                    self.test_url = 'https://api.sandbox.deepstack.io'
                                    self.live_url = 'https://api.deepstack.io'
                              
                                    self.supported_countries = ['US']
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/deepstack.rb - About 4 hrs to fix

                                Method build_mass_pay_request has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def build_mass_pay_request(*args)
                                        default_options = args.last.is_a?(Hash) ? args.pop : {}
                                        recipients = args.first.is_a?(Array) ? args : [args]
                                        receiver_type = default_options[:receiver_type]
                                
                                
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb - About 4 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

                                Severity
                                Category
                                Status
                                Source
                                Language