activemerchant/active_merchant

View on GitHub

Showing 999 of 1,496 total issues

Class ModernPaymentsCimGateway has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

    class ModernPaymentsCimGateway < Gateway #:nodoc:
      self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
      self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'

      LIVE_XMLNS = 'https://secure.modpay.com/ws/'
Severity: Minor
Found in lib/active_merchant/billing/gateways/modern_payments_cim.rb - About 2 hrs to fix

    Class ItransactGateway has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class ItransactGateway < Gateway
          self.live_url = self.test_url = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
    
          # The countries the gateway supports merchants from as 2 digit ISO country codes
          self.supported_countries = ['US']
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/itransact.rb - About 2 hrs to fix

      Class SoEasyPayGateway has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class SoEasyPayGateway < Gateway
            self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
            self.money_format = :cents
      
            self.supported_countries = %w[
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/so_easy_pay.rb - About 2 hrs to fix

        File data_cash.rb has 256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'active_support/core_ext/string/access'
        
        module ActiveMerchant
          module Billing
            class DataCashGateway < Gateway
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/data_cash.rb - About 2 hrs to fix

          Method build_xml_request has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def build_xml_request(action, data)
                  xml = Builder::XmlMarkup.new indent: 2
                  xml.Request(version: '1.0') do
                    xml.Header do
                      xml.Security(sender: @options[:sender], type: 'MERCHANT')
          Severity: Major
          Found in lib/active_merchant/billing/gateways/bank_frick.rb - About 2 hrs to fix

            File optimal_payment.rb has 254 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ActiveMerchant #:nodoc:
              module Billing #:nodoc:
                class OptimalPaymentGateway < Gateway
                  self.test_url = 'https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
                  self.live_url = 'https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1'
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/optimal_payment.rb - About 2 hrs to fix

              File qvalent.rb has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module ActiveMerchant #:nodoc:
                module Billing #:nodoc:
                  class QvalentGateway < Gateway
                    self.display_name = 'Qvalent'
                    self.homepage_url = 'https://www.qvalent.com/'
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/qvalent.rb - About 2 hrs to fix

                Method add_payment_profile has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_payment_profile(xml, payment_profile)
                        # 'individual' or 'business' (optional)
                        xml.tag!('customerType', payment_profile[:customer_type]) if payment_profile[:customer_type]
                
                        if payment_profile[:bill_to]
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/authorize_net_cim.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 build_merchant_mpi_external has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def build_merchant_mpi_external(xml, data)
                        return unless data[:txid] || data[:threeDSServerTransID]
                
                        ds_merchant_mpi_external = {}
                        ds_merchant_mpi_external[:TXID] = data[:txid] if data[:txid]
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/redsys.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 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_address(xml, address, options)
                        return unless address
                
                        address = address_with_defaults(address)
                
                
                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 parse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def parse(action, soap)
                        xml = REXML::Document.new(soap)
                        root = REXML::XPath.first(xml, '//SOAP-ENV:Body')
                        response = root ? parse_element(root[0]) : { response: soap }
                
                
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/usa_epay_advanced.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_billing_address has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_billing_address(xml, payment_source, options)
                        address = options[:billing_address] || options[:address] || {}
                
                        xml.billTo do
                          first_name, last_name = names_from(payment_source, address, options)
                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_lodging_data has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_lodging_data(post, options)
                        return unless lodging_options = options[:lodging_data]
                
                        lodging_data = {}
                
                
                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 transaction_element has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def transaction_element(action, parameters)
                        transaction = REXML::Element.new(action)
                
                        # Must add the elements in the correct order
                        actions[action].each do |key|
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/moneris.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 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_address(post, options)
                        if address = options[:billing_address] || options[:address]
                          post[:address] = address[:address1] if address[:address1]
                          post[:address2] = address[:address2] if address[:address2]
                          post[:city] = address[:city] if address[:city]
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/card_connect.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 16 (exceeds 5 allowed). Consider refactoring.
                Open

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

                      def add_address(post, options)
                        return unless post[:card]&.kind_of?(Hash)
                
                        if address = options[:billing_address] || options[:address]
                          post[:card][:address_line1] = address[:address1] if address[:address1]
                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 post_data has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def post_data(params)
                        return nil unless params
                
                        params.map do |key, value|
                          next if value != false && value.blank?
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/pagarme.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_billing_address has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_billing_address(xml, creditcard, options)
                        address = options[:billing_address]
                        return unless address
                
                        xml.billing do
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/maxipago.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_shipping has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                      def add_shipping(xml, shipping)
                        xml.tag!('v1:Shipping') do
                          xml.tag!('v1:Type', shipping[:type]) if shipping[:type]
                          xml.tag!('v1:Name', shipping[:name]) if shipping[:name]
                          xml.tag!('v1:Address1', shipping[:address_1]) if shipping[:address_1]
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/ipg.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