activemerchant/active_merchant

View on GitHub

Showing 992 of 1,478 total issues

Class DecidirGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

    class DecidirGateway < Gateway
      self.test_url = 'https://developers.decidir.com/api/v2'
      self.live_url = 'https://live.decidir.com/api/v2'

      self.supported_countries = ['AR']
Severity: Minor
Found in lib/active_merchant/billing/gateways/decidir.rb - About 3 hrs to fix

    Class SmartPs has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class SmartPs < Gateway #:nodoc:
          ##
          # This is the base gateway for processors who use the smartPS processing system
    
          self.abstract_class = true
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/smart_ps.rb - About 3 hrs to fix

      Class TelrGateway has 31 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class TelrGateway < Gateway
            self.display_name = 'Telr'
            self.homepage_url = 'http://www.telr.com/'
      
            self.live_url = 'https://secure.telr.com/gateway/remote.xml'
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/telr.rb - About 3 hrs to fix

        Method transaction_hash has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def transaction_hash(result)
                unless result.success?
                  return { 'processor_response_code' => response_code_from_result(result),
                           'additional_processor_response' => additional_processor_response_from_result(result),
                           'payment_instrument_type' => payment_instrument_type(result.transaction),
        Severity: Major
        Found in lib/active_merchant/billing/gateways/braintree_blue.rb - About 3 hrs to fix

          Method build_request has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

                def build_request(action)
                  xml = Builder::XmlMarkup.new(encoding: 'UTF-8')
                  xml.instruct!(:xml, encoding: 'UTF-8')
                  xml.SOAP :Envelope, {
                    'xmlns:SOAP' => 'http://schemas.xmlsoap.org/soap/envelope/',
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/hps.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_external_mpi_fields has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

                def add_external_mpi_fields(data, options)
                  return unless options[:three_d_secure]
          
                  if options[:three_d_secure][:version] == THREE_DS_V2
                    data[:threeDSServerTransID] = options[:three_d_secure][:three_ds_server_trans_id] if options[:three_d_secure][:three_ds_server_trans_id]
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/redsys.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 parse_cim has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

                def parse_cim(body, options)
                  response = {}
          
                  doc = Nokogiri::XML(body).remove_namespaces!
          
          
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/authorize_net.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_billing_address has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

                def add_billing_address(post, options)
                  if (address = (options[:billing_address] || options[:address]))
                    post[:billing_address] = {}
                    post[:billing_address][:street1] = address[:address1] if address[:address1]
                    post[:billing_address][:street2] = address[:address2] if address[:address2]
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/conekta.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_purchases_data has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

                def add_purchases_data(params, options)
                  return unless options[:purchases]
          
                  params['purchases'] = []
          
          
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/priority.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 country.rb has 320 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module ActiveMerchant #:nodoc:
            class InvalidCountryCodeError < StandardError
            end
          
            class CountryCodeFormatError < StandardError
          Severity: Minor
          Found in lib/active_merchant/country.rb - About 3 hrs to fix

            Class VisanetPeruGateway has 30 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class VisanetPeruGateway < Gateway
                  include Empty
                  self.display_name = 'VisaNet Peru Gateway'
                  self.homepage_url = 'http://www.visanet.com.pe'
            
            
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/visanet_peru.rb - About 3 hrs to fix

              Class MercuryGateway has 30 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class MercuryGateway < Gateway
                    URLS = {
                      test: 'https://w1.mercurycert.net/ws/ws.asmx',
                      live: 'https://w1.mercurypay.com/ws/ws.asmx'
                    }
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/mercury.rb - About 3 hrs to fix

                Class XpayGateway has 30 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class XpayGateway < Gateway
                      self.display_name = 'XPay Gateway'
                      self.homepage_url = 'https://developer.nexi.it/en'
                
                      self.test_url = 'https://xpaysandbox.nexigroup.com/api/phoenix-0.0/psp/api/v1/'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/xpay.rb - About 3 hrs to fix

                  Class OmiseGateway has 30 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class OmiseGateway < Gateway
                        API_URL     = 'https://api.omise.co/'
                        VAULT_URL   = 'https://vault.omise.co/'
                  
                        STANDARD_ERROR_CODE_MAPPING = {
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/omise.rb - About 3 hrs to fix

                    Class MerchantWarriorGateway has 30 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class MerchantWarriorGateway < Gateway
                          TOKEN_TEST_URL = 'https://base.merchantwarrior.com/token/'
                          TOKEN_LIVE_URL = 'https://api.merchantwarrior.com/token/'
                    
                          POST_TEST_URL = 'https://base.merchantwarrior.com/post/'
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/merchant_warrior.rb - About 3 hrs to fix

                      File mundipagg.rb has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

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

                        Method add_card_or_token_payment has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_card_or_token_payment(xml, card_or_token, options)
                                xml.hps :CardData do
                                  if card_or_token.respond_to?(:number)
                                    if card_or_token.track_data
                                      xml.tag!('hps:TrackData', 'method' => 'swipe') do
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/hps.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_customer has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def add_customer(request, payment_method, options)
                                address = options[:billing_address] || options[:address]
                        
                                request[:customer] = {}
                                request[:customer][:email] = options[:email] || 'support@monei.net'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/monei.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 paymentez.rb has 314 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'base64'
                        require 'digest'
                        
                        module ActiveMerchant #:nodoc:
                          module Billing #:nodoc:
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/paymentez.rb - About 3 hrs to fix

                          Class UsaEpayTransactionGateway has 29 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class UsaEpayTransactionGateway < Gateway
                                self.live_url = 'https://www.usaepay.com/gate'
                                self.test_url = 'https://sandbox.usaepay.com/gate'
                          
                                self.supported_cardtypes  = %i[visa master american_express]
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/usa_epay_transaction.rb - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language