activemerchant/active_merchant

View on GitHub

Showing 1,478 of 1,478 total issues

Method add_level_3_fields has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

      def add_level_3_fields(xml, options)
        level_3_data = options[:level_3_data]
        xml.ssl_customer_code           level_3_data[:customer_code] if level_3_data[:customer_code]
        xml.ssl_salestax                level_3_data[:salestax] if level_3_data[:salestax]
        xml.ssl_salestax_indicator      level_3_data[:salestax_indicator] if level_3_data[:salestax_indicator]
Severity: Minor
Found in lib/active_merchant/billing/gateways/elavon.rb - About 3 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 card_connect.rb has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class CardConnectGateway < Gateway
      self.test_url = 'https://fts-uat.cardconnect.com/cardconnect/rest/'
      self.live_url = 'https://fts.cardconnect.com/cardconnect/rest/'
Severity: Minor
Found in lib/active_merchant/billing/gateways/card_connect.rb - About 3 hrs to fix

    Class NetworkMerchantsGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class NetworkMerchantsGateway < Gateway
          self.live_url = self.test_url = 'https://secure.networkmerchants.com/api/transact.php'
    
          self.supported_countries = ['US']
          self.supported_cardtypes = %i[visa master american_express discover]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/network_merchants.rb - About 3 hrs to fix

      Class MerchantWareGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class MerchantWareGateway < Gateway
            class_attribute :v4_live_url
      
            self.live_url = self.test_url = 'https://ps1.merchantware.net/MerchantWARE/ws/RetailTransaction/TXRetail.asmx'
            self.v4_live_url = 'https://ps1.merchantware.net/Merchantware/ws/RetailTransaction/v4/Credit.asmx'
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/merchant_ware.rb - About 3 hrs to fix

        Class BpointGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class BpointGateway < Gateway
              self.live_url = 'https://www.bpoint.com.au/evolve/service_1_4_4.asmx'
        
              self.supported_countries = ['AU']
              self.default_currency = 'AUD'
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/bpoint.rb - About 3 hrs to fix

          Class CtPaymentGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class CtPaymentGateway < Gateway
                self.test_url = 'https://test.ctpaiement.ca/v1/'
                self.live_url = 'https://www.ctpaiement.com/v1/'
          
                self.supported_countries = %w[US CA]
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/ct_payment.rb - About 3 hrs to fix

            Class PaymillGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class PaymillGateway < Gateway
                  self.supported_countries = %w(AD AT BE BG CH CY CZ DE DK EE ES FI FO FR GB
                                                GI GR HR HU IE IL IM IS IT LI LT LU LV MC MT
                                                NL NO PL PT RO SE SI SK TR VA)
            
            
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/paymill.rb - About 3 hrs to fix

              Class ReachGateway has 27 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class ReachGateway < Gateway
                    self.test_url = 'https://checkout.rch.how/'
                    self.live_url = 'https://checkout.rch.io/'
              
                    self.supported_countries = %w(AE AG AL AM AT AU AW AZ BA BB BD BE BF BG BH BJ BM BN BO BR BS BW BZ CA CD CF
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/reach.rb - About 3 hrs to fix

                Class CreditCard has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class CreditCard < Model
                      include CreditCardMethods
                
                      BRANDS_WITH_SPACES_IN_NUMBER = %w(bp_plus)
                
                
                Severity: Minor
                Found in lib/active_merchant/billing/credit_card.rb - About 3 hrs to fix

                  File wirecard.rb has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'base64'
                  
                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      class WirecardGateway < Gateway
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/wirecard.rb - About 3 hrs to fix

                    Method add_customer_data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def add_customer_data(post, options)
                            post[:customer] = {}
                            post[:customer][:email] = options[:email] || nil
                            post[:payment_ip] = options[:ip] if options[:ip]
                            address = options[:billing_address]
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/checkout_v2.rb - About 3 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_subscription has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def add_subscription(xml, options, reference = nil)
                            options[:subscription] ||= {}
                    
                            xml.tag! 'recurringSubscriptionInfo' do
                              if reference
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/cyber_source.rb - About 3 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 payex.rb has 295 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File netbanx.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module ActiveMerchant #:nodoc:
                        module Billing #:nodoc:
                          class NetbanxGateway < Gateway
                            # Netbanx is the new REST based API for Optimal Payments / Paysafe
                            self.test_url = 'https://api.test.netbanx.com/'
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/netbanx.rb - About 3 hrs to fix

                        File kushki.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module ActiveMerchant #:nodoc:
                          module Billing #:nodoc:
                            class KushkiGateway < Gateway
                              self.display_name = 'Kushki'
                              self.homepage_url = 'https://www.kushkipagos.com'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/kushki.rb - About 3 hrs to fix

                          File mercado_pago.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          module ActiveMerchant #:nodoc:
                            module Billing #:nodoc:
                              class MercadoPagoGateway < Gateway
                                self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
                          
                          
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/mercado_pago.rb - About 3 hrs to fix

                            File d_local.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            module ActiveMerchant #:nodoc:
                              module Billing #:nodoc:
                                class DLocalGateway < Gateway
                                  self.test_url = 'https://sandbox.dlocal.com'
                                  self.live_url = 'https://api.dlocal.com'
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/d_local.rb - About 3 hrs to fix

                              File world_net.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require 'nokogiri'
                              
                              module ActiveMerchant #:nodoc:
                                module Billing #:nodoc:
                                  # See https://helpdesk.worldnettps.com/support/solutions/articles/1000167298-integrator-guide
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/world_net.rb - About 3 hrs to fix

                                Class BridgePayGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                    class BridgePayGateway < Gateway
                                      self.display_name = 'BridgePay'
                                      self.homepage_url = 'http://www.bridgepaynetwork.com/'
                                
                                      self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/bridge_pay.rb - About 3 hrs to fix

                                  Class MerchantPartnersGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                      class MerchantPartnersGateway < Gateway
                                        self.display_name = 'Merchant Partners'
                                        self.homepage_url = 'http://www.merchantpartners.com/'
                                  
                                        self.live_url = 'https://trans.merchantpartners.com/cgi-bin/ProcessXML.cgi'
                                  Severity: Minor
                                  Found in lib/active_merchant/billing/gateways/merchant_partners.rb - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language