activemerchant/active_merchant

View on GitHub

Showing 992 of 1,478 total issues

Method add_address has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def add_address(post, options)
        if address = options[:billing_address]
          post[:billingFirstName] = address[:first_name] if address[:first_name]
          post[:billingLastName] = address[:last_name] if address[:last_name]
          post[:billingCompanyName] = address[:company] if address[:company]
Severity: Minor
Found in lib/active_merchant/billing/gateways/pay_junction_v2.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 cenpos.rb has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'nokogiri'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class CenposGateway < Gateway
Severity: Minor
Found in lib/active_merchant/billing/gateways/cenpos.rb - About 2 hrs to fix

    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

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

          class GlobalTransportGateway < Gateway
            self.test_url = 'https://certapia.globalpay.com/GlobalPay/transact.asmx/ProcessCreditCard'
            self.live_url = 'https://api.globalpay.com/GlobalPay/transact.asmx/ProcessCreditCard'
      
            self.supported_countries = %w(CA PR US)
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/global_transport.rb - About 2 hrs to fix

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

            class NetpayGateway < Gateway
              self.test_url = 'http://200.57.87.243:8855'
              self.live_url = 'https://suite.netpay.com.mx/acquirerprd'
        
              # The countries the gateway supports merchants from as 2 digit ISO country codes
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/netpay.rb - About 2 hrs to fix

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

              class OpenpayGateway < Gateway
                class_attribute :mx_live_url, :mx_test_url
                class_attribute :co_live_url, :co_test_url
          
                self.co_live_url = 'https://api.openpay.co/v1/'
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/openpay.rb - About 2 hrs to fix

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

                class MicropaymentGateway < Gateway
                  self.display_name = 'micropayment'
                  self.homepage_url = 'https://www.micropayment.de/'
            
                  self.test_url = self.live_url = 'https://sipg.micropayment.de/public/creditcardpsp/v1/nvp/'
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/micropayment.rb - About 2 hrs to fix

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

                  class S5Gateway < Gateway
                    self.test_url = 'https://test.ctpe.io/payment/ctpe'
                    self.live_url = 'https://ctpe.io/payment/ctpe'
              
                    self.supported_countries = ['DK']
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/s5.rb - About 2 hrs to fix

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

                    class TrexleGateway < Gateway
                      self.test_url = 'https://core.trexle.com/api/v1'
                      self.live_url = 'https://core.trexle.com/api/v1'
                
                      self.default_currency = 'USD'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/trexle.rb - About 2 hrs to fix

                  File securion_pay.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    File monei.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File iats_payments.rb has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module ActiveMerchant #:nodoc:
                        module Billing #:nodoc:
                          class IatsPaymentsGateway < Gateway
                            class_attribute :live_na_url, :live_uk_url
                      
                      
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/iats_payments.rb - About 2 hrs to fix

                        Method add_d3d has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_d3d(post, options)
                                add_pair post, 'FLAG3D', 'Y'
                                win_3ds = THREE_D_SECURE_DISPLAY_WAYS.key?(options[:win_3ds]) ?
                                  THREE_D_SECURE_DISPLAY_WAYS[options[:win_3ds]] :
                                  THREE_D_SECURE_DISPLAY_WAYS[:main_window]
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/ogone.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 parse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def parse(body)
                                response = {}
                        
                                root = REXML::Document.new(body).root
                        
                        
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/cecabank/cecabank_xml.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 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_address(doc, address)
                                return unless address
                        
                                doc.companyName(address[:company]) unless address[:company].blank?
                                doc.addressLine1(truncate(address[:address1], 35)) unless address[:address1].blank?
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/litle.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_sub_merchant_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_sub_merchant_data(xml, options)
                                xml.subMerchantData do
                                  xml.pfId options[:pf_id] if options[:pf_id]
                                  xml.subName options[:sub_name] if options[:sub_name]
                                  xml.subId options[:sub_id] if options[:sub_id]
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/worldpay.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_rooms has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_rooms(lodging_options)
                                rooms = []
                                lodging_options[:rooms]&.each do |item|
                                  room = {}
                                  room['dailyRoomRate'] = item[:daily_room_rate] if item[:daily_room_rate]
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/global_collect.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_three_d_secure has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_three_d_secure(xml, options)
                                three_d_secure = options[:three_d_secure]
                                xml.tag! 'ThreeDSecureRequest' do
                                  xml.tag! 'MpiVendor3ds', 'Y'
                                  xml.tag! 'AuthStatus3ds', three_d_secure[:authentication_response_status] || three_d_secure[:trans_status] if three_d_secure[:authentication_response_status] || three_d_secure[:trans_status]
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/paypal.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 store has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def store(creditcard, options = {})
                                post = {}
                                post[:client_id] = @options[:client_id]
                                post[:user_name] = "#{creditcard.first_name} #{creditcard.last_name}"
                                post[:email] = options[:email] || 'unspecified@example.com'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/wepay.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_product_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_product_data(post, money, options)
                                post[:account_id] = @options[:account_id]
                                post[:amount] = amount(money)
                                post[:short_description] = (options[:description] || 'Purchase')
                                post[:type] = (options[:type] || 'goods')
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/wepay.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

                        Severity
                        Category
                        Status
                        Source
                        Language