activemerchant/active_merchant

View on GitHub

Showing 999 of 1,496 total issues

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

      def add_shipping_address(post, options)
        if address = options[:shipping_address]
          post[:shipping] = {}
          post[:shipping][:address] = {}
          post[:shipping][:address][:address_line1] = address[:address1] unless address[:address1].blank?
Severity: Minor
Found in lib/active_merchant/billing/gateways/checkout_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

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

      def add_3ds(post, options)
        if three_ds_2_options = options[:three_ds_2]
          device_channel = three_ds_2_options[:channel]
          if device_channel == 'app'
            post[:threeDS2RequestData] = { deviceChannel: device_channel }
Severity: Minor
Found in lib/active_merchant/billing/gateways/adyen.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_settings has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def add_settings(xml, source, options)
        xml.transactionSettings do
          if options[:recurring] || subsequent_recurring_transaction?(options)
            xml.setting do
              xml.settingName('recurringBilling')
Severity: Minor
Found in lib/active_merchant/billing/gateways/authorize_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_source_owner has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def add_source_owner(post, creditcard, options)
        post[:owner] = {}
        post[:owner][:name] = creditcard.name if creditcard.respond_to?(:name) && creditcard.name
        post[:owner][:email] = options[:email] if options[:email]

Severity: Minor
Found in lib/active_merchant/billing/gateways/stripe.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 verify has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def verify(creditcard, options = {})
        if options[:allow_card_verification] == true
          options.delete(:allow_card_verification)
          exp_month = creditcard.month.to_s
          exp_year = creditcard.year.to_s
Severity: Minor
Found in lib/active_merchant/billing/gateways/braintree_blue.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_buyer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def add_buyer(post, payment_method, options)
        buyer = {}
        if buyer_hash = options[:buyer]
          buyer[:fullName] = buyer_hash[:name]
          buyer[:dniNumber] = buyer_hash[:dni_number]
Severity: Minor
Found in lib/active_merchant/billing/gateways/payu_latam.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_additional_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

      def add_additional_data(params, options)
        params['isAuth'] = options[:is_auth].present? ? options[:is_auth] : 'true'
        params['paymentType'] = options[:payment_type].present? ? options[:payment_type] : 'Sale'
        params['tenderType'] = options[:tender_type].present? ? options[:tender_type] : 'Card'
        params['taxExempt'] = options[:tax_exempt].present? ? options[:tax_exempt] : 'false'
Severity: Minor
Found in lib/active_merchant/billing/gateways/priority.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 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 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 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 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 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 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

                        Severity
                        Category
                        Status
                        Source
                        Language