Shopify/active_merchant

View on GitHub

Showing 977 of 1,450 total issues

File element.rb has 373 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'nokogiri'
require 'securerandom'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
Severity: Minor
Found in lib/active_merchant/billing/gateways/element.rb - About 4 hrs to fix

    Method add_three_d_secure has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_three_d_secure(options, xml)
            if options[:three_d_secure]
              three_d_secure = options[:three_d_secure]
              xml.tag! 'BuyerAuthResult' do
                authentication_status(three_d_secure, xml)
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/payflow.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_payout_destination_data has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_payout_destination_data(post, options)
            return unless options[:payout] == true
    
            post[:destination] ||= {}
            post[:destination][:account_holder] ||= {}
    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

    File skip_jack.rb has 370 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        class SkipJackGateway < Gateway
          API_VERSION = '?.?'
    
    
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/skip_jack.rb - About 4 hrs to fix

      Class RealexGateway has 37 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class RealexGateway < Gateway
            self.live_url = self.test_url = 'https://epage.payandshop.com/epage-remote.cgi'
      
            CARD_MAPPING = {
              'master'            => 'MC',
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/realex.rb - About 4 hrs to fix

        Class PayflowGateway has 37 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class PayflowGateway < Gateway
              include PayflowCommonAPI
        
              RECURRING_ACTIONS = Set.new(%i[add modify cancel inquiry reactivate payment])
        
        
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/payflow.rb - About 4 hrs to fix

          Class VantivExpressGateway has 37 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class VantivExpressGateway < Gateway
                self.test_url = 'https://certtransaction.elementexpress.com'
                self.live_url = 'https://transaction.elementexpress.com'
          
                self.supported_countries = ['US']
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/vantiv_express.rb - About 4 hrs to fix

            Class HpsGateway has 37 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class HpsGateway < Gateway
                  self.live_url = 'https://posgateway.secureexchange.net/Hps.Exchange.PosGateway/PosGatewayService.asmx?wsdl'
                  self.test_url = 'https://posgateway.cert.secureexchange.net/Hps.Exchange.PosGateway/PosGatewayService.asmx?wsdl'
            
                  self.supported_countries = ['US']
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/hps.rb - About 4 hrs to fix

              Class Latitude19Gateway has 37 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Latitude19Gateway < Gateway
                    self.display_name = 'Latitude19 Gateway'
                    self.homepage_url = 'http://www.l19tech.com'
              
                    self.live_url = 'https://gateway.l19tech.com/payments/'
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/latitude19.rb - About 4 hrs to fix

                File cyber_source_rest.rb has 368 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'active_merchant/billing/gateways/cyber_source/cyber_source_common'
                
                module ActiveMerchant #:nodoc:
                  module Billing #:nodoc:
                    class CyberSourceRestGateway < Gateway
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/cyber_source_rest.rb - About 4 hrs to fix

                  Method add_auth_network_tokenization has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def add_auth_network_tokenization(xml, payment_method, options)
                          return unless network_tokenization?(payment_method)
                  
                          commerce_indicator = 'internet' if subsequent_nt_apple_pay_auth(payment_method.source, options)
                  
                  
                  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 moneris.rb has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'rexml/document'
                  
                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      # To learn more about the Moneris gateway, please contact
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/moneris.rb - About 4 hrs to fix

                    File ipg.rb has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module ActiveMerchant #:nodoc:
                      module Billing #:nodoc:
                        class IpgGateway < Gateway
                          self.test_url = 'https://test.ipg-online.com/ipgapi/services'
                          self.live_url = 'https://www5.ipg-online.com/ipgapi/services'
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/ipg.rb - About 4 hrs to fix

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

                          class EbanxGateway < Gateway
                            self.test_url = 'https://sandbox.ebanxpay.com/ws/'
                            self.live_url = 'https://api.ebanxpay.com/ws/'
                      
                            self.supported_countries = %w(BR MX CO CL AR PE BO EC)
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/ebanx.rb - About 4 hrs to fix

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

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

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

                              class DLocalGateway < Gateway
                                self.test_url = 'https://sandbox.dlocal.com'
                                self.live_url = 'https://api.dlocal.com'
                          
                                self.supported_countries = %w[AR BD BO BR CL CM CN CO CR DO EC EG GH GT IN ID JP KE MY MX MA NG PA PY PE PH SN SV TH TR TZ UG UY VN ZA]
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/d_local.rb - About 4 hrs to fix

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

                                class MoneiGateway < Gateway
                                  self.live_url = self.test_url = 'https://api.monei.com/v1/payments'
                            
                                  self.supported_countries = %w[AD AT BE BG CA CH CY CZ DE DK EE ES FI FO FR GB GI GR HU IE IL IS IT LI LT LU LV MT NL NO PL PT RO SE SI SK TR US VA]
                                  self.default_currency = 'EUR'
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/monei.rb - About 4 hrs to fix

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

                                  class NmiGateway < Gateway
                                    include Empty
                              
                                    DUP_WINDOW_DEPRECATION_MESSAGE = 'The class-level duplicate_window variable is deprecated. Please use the :dup_seconds transaction option instead.'
                              
                              
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/nmi.rb - About 4 hrs to fix

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

                                    class CenposGateway < Gateway
                                      self.display_name = 'CenPOS'
                                      self.homepage_url = 'https://www.cenpos.com/'
                                
                                      self.live_url = 'https://ww3.cenpos.net/6/transact.asmx'
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/cenpos.rb - About 4 hrs to fix

                                  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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language