activemerchant/active_merchant

View on GitHub

Showing 999 of 1,496 total issues

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

      def add_payment_sender_data(post, options)
        return unless options[:sender].is_a?(Hash)

        sender = options[:sender]

Severity: Minor
Found in lib/active_merchant/billing/gateways/checkout_v2.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 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

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

      def build_reference_request(action, money, authorization, options)
        xml = Builder::XmlMarkup.new
        xml.tag! TRANSACTIONS[action] do
          xml.tag! 'PNRef', authorization

Severity: Minor
Found in lib/active_merchant/billing/gateways/payflow/payflow_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

File firstdata_e4.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class FirstdataE4Gateway < Gateway
      # TransArmor support requires v11 or lower
      self.test_url = 'https://api.demo.globalgatewaye4.firstdata.com/transaction/v11'
Severity: Minor
Found in lib/active_merchant/billing/gateways/firstdata_e4.rb - About 4 hrs to fix

    File jetpay.rb has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        class JetpayGateway < Gateway
          class_attribute :live_us_url, :live_ca_url
    
    
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/jetpay.rb - About 4 hrs to fix

      Class SimetrikGateway has 33 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class SimetrikGateway < Gateway
            self.test_url = 'https://payments.sta.simetrik.com/v1'
            self.live_url = 'https://payments.simetrik.com/v1'
      
            class_attribute :test_auth_url, :live_auth_url, :test_audience, :live_audience
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/simetrik.rb - About 4 hrs to fix

        Class OptimalPaymentGateway has 33 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class OptimalPaymentGateway < Gateway
              self.test_url = 'https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
              self.live_url = 'https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
        
              # The countries the gateway supports merchants from as 2 digit ISO country codes
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/optimal_payment.rb - About 4 hrs to fix

          Class CardConnectGateway has 33 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class CardConnectGateway < Gateway
                self.test_url = 'https://fts-uat.cardconnect.com/cardconnect/rest/'
                self.live_url = 'https://fts.cardconnect.com/cardconnect/rest/'
          
                self.supported_countries = ['US']
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/card_connect.rb - About 4 hrs to fix

            Class BluePayGateway has 33 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class BluePayGateway < Gateway
                  class_attribute :rebilling_url, :ignore_http_status
            
                  self.live_url      = 'https://secure.bluepay.com/interfaces/bp20post'
                  self.rebilling_url = 'https://secure.bluepay.com/interfaces/bp20rebadmin'
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/blue_pay.rb - About 4 hrs to fix

              Class KushkiGateway has 33 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class KushkiGateway < Gateway
                    self.display_name = 'Kushki'
                    self.homepage_url = 'https://www.kushkipagos.com'
              
                    self.test_url = 'https://api-uat.kushkipagos.com/'
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/kushki.rb - About 4 hrs to fix

                File rapyd.rb has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module ActiveMerchant #:nodoc:
                  module Billing #:nodoc:
                    class RapydGateway < Gateway
                      class_attribute :payment_redirect_test, :payment_redirect_live
                
                
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/rapyd.rb - About 4 hrs to fix

                  File decidir.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      class DecidirGateway < Gateway
                        self.test_url = 'https://developers.decidir.com/api/v2'
                        self.live_url = 'https://live.decidir.com/api/v2'
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/decidir.rb - About 4 hrs to fix

                    File barclaycard_smartpay.rb has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module ActiveMerchant #:nodoc:
                      module Billing #:nodoc:
                        class BarclaycardSmartpayGateway < Gateway
                          self.test_url = 'https://pal-test.barclaycardsmartpay.com/pal/servlet'
                          self.live_url = 'https://pal-live.barclaycardsmartpay.com/pal/servlet'
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/barclaycard_smartpay.rb - About 4 hrs to fix

                      File card_stream.rb has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module ActiveMerchant #:nodoc:
                        module Billing #:nodoc:
                          class CardStreamGateway < Gateway
                            THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = 'Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead.'
                      
                      
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/card_stream.rb - About 4 hrs to fix

                        Class ForteGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class ForteGateway < Gateway
                              include Empty
                        
                              self.test_url = 'https://sandbox.forte.net/api/v2'
                              self.live_url = 'https://api.forte.net/v2'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/forte.rb - About 4 hrs to fix

                          Class PayConexGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class PayConexGateway < Gateway
                                include Empty
                          
                                self.test_url = 'https://cert.payconex.net/api/qsapi/3.8/'
                                self.live_url = 'https://secure.payconex.net/api/qsapi/3.8/'
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/pay_conex.rb - About 4 hrs to fix

                            Class VancoGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class VancoGateway < Gateway
                                  include Empty
                            
                                  self.test_url = 'https://uat.vancopayments.com/cgi-bin/ws2.vps'
                                  self.live_url = 'https://myvanco.vancopayments.com/cgi-bin/ws2.vps'
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/vanco.rb - About 4 hrs to fix

                              Class CecabankJsonGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class CecabankJsonGateway < Gateway
                                    include CecabankCommon
                              
                                    CECA_ACTIONS_DICTIONARY = {
                                      purchase: :REST_AUTORIZACION,
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb - About 4 hrs to fix

                                Class CardknoxGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                    class CardknoxGateway < Gateway
                                      self.live_url = 'https://x1.cardknox.com/gateway'
                                
                                      self.supported_countries = %w[US CA GB]
                                      self.default_currency = 'USD'
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/cardknox.rb - About 4 hrs to fix

                                  Class PinGateway has 32 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                      class PinGateway < Gateway
                                        self.test_url = 'https://test-api.pinpayments.com/1'
                                        self.live_url = 'https://api.pinpayments.com/1'
                                  
                                        self.default_currency = 'AUD'
                                  Severity: Minor
                                  Found in lib/active_merchant/billing/gateways/pin.rb - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language