activemerchant/active_merchant

View on GitHub

Showing 1,501 of 1,501 total issues

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

    class MitGateway < Gateway
      self.live_url = 'https://wpy.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
      self.test_url = 'https://scqa.mitec.com.mx/ModuloUtilWS/activeCDP.htm'

      self.supported_countries = ['MX']
Severity: Minor
Found in lib/active_merchant/billing/gateways/mit.rb - About 2 hrs to fix

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

        class InspireGateway < Gateway
          self.live_url = self.test_url = 'https://secure.inspiregateway.net/api/transact.php'
    
          self.supported_countries = ['US']
          self.supported_cardtypes = %i[visa master american_express]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/inspire.rb - About 2 hrs to fix

      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 WepayGateway has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class WepayGateway < Gateway
              self.test_url = 'https://stage.wepayapi.com/v2'
              self.live_url = 'https://wepayapi.com/v2'
        
              self.supported_countries = %w[US CA]
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/wepay.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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                        first_name, last_name = split_names(billing_address[:name])
                        add_pair(post, :BillingSurname, truncate(last_name, 20))
                        add_pair(post, :BillingFirstnames, truncate(first_name, 20))
                        add_pair(post, :BillingAddress1, truncate(billing_address[:address1], 100))
                        add_pair(post, :BillingAddress2, truncate(billing_address[:address2], 100))
              Severity: Major
              Found in lib/active_merchant/billing/gateways/sage_pay.rb and 1 other location - About 2 hrs to fix
              lib/active_merchant/billing/gateways/sage_pay.rb on lines 322..331

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    PAYMENT_GATEWAY_RESPONSES = {
                      'P01' => 'AVS Mismatch Failure',
                      'P02' => 'CVV2 Mismatch Failure',
                      'P21' => 'Transaction may not be marked',
                      'P30' => 'Test Tran. Bad Card',
              Severity: Major
              Found in lib/active_merchant/billing/gateways/plugnpay.rb and 1 other location - About 2 hrs to fix
              lib/active_merchant/billing/gateways/pro_pay.rb on lines 93..133

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                        first_name, last_name = split_names(shipping_address[:name])
                        add_pair(post, :DeliverySurname, truncate(last_name, 20))
                        add_pair(post, :DeliveryFirstnames, truncate(first_name, 20))
                        add_pair(post, :DeliveryAddress1, truncate(shipping_address[:address1], 100))
                        add_pair(post, :DeliveryAddress2, truncate(shipping_address[:address2], 100))
              Severity: Major
              Found in lib/active_merchant/billing/gateways/sage_pay.rb and 1 other location - About 2 hrs to fix
              lib/active_merchant/billing/gateways/sage_pay.rb on lines 309..318

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    TRANSACTION_RESPONSE_CODES = {
                      '00' => 'Success',
                      '1' => 'Transaction blocked by issuer',
                      '4' => 'Pick up card and deny transaction',
                      '5' => 'Problem with the account',
              Severity: Major
              Found in lib/active_merchant/billing/gateways/pro_pay.rb and 1 other location - About 2 hrs to fix
              lib/active_merchant/billing/gateways/plugnpay.rb on lines 39..79

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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 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_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 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 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_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

                      Severity
                      Category
                      Status
                      Source
                      Language