activemerchant/active_merchant

View on GitHub

Showing 992 of 1,478 total issues

Method add_customer_data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

      def add_customer_data(post, options)
        post[:customer] = {}
        post[:customer][:email] = options[:email] || nil
        post[:payment_ip] = options[:ip] if options[:ip]
        address = options[:billing_address]
Severity: Minor
Found in lib/active_merchant/billing/gateways/checkout_v2.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_subscription has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

      def add_subscription(xml, options, reference = nil)
        options[:subscription] ||= {}

        xml.tag! 'recurringSubscriptionInfo' do
          if reference
Severity: Minor
Found in lib/active_merchant/billing/gateways/cyber_source.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 payex.rb has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'nokogiri'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PayexGateway < Gateway
Severity: Minor
Found in lib/active_merchant/billing/gateways/payex.rb - About 3 hrs to fix

    File netbanx.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        class NetbanxGateway < Gateway
          # Netbanx is the new REST based API for Optimal Payments / Paysafe
          self.test_url = 'https://api.test.netbanx.com/'
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/netbanx.rb - About 3 hrs to fix

      File kushki.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module ActiveMerchant #:nodoc:
        module Billing #:nodoc:
          class KushkiGateway < Gateway
            self.display_name = 'Kushki'
            self.homepage_url = 'https://www.kushkipagos.com'
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/kushki.rb - About 3 hrs to fix

        File mercado_pago.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          File d_local.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module ActiveMerchant #:nodoc:
            module Billing #:nodoc:
              class DLocalGateway < Gateway
                self.test_url = 'https://sandbox.dlocal.com'
                self.live_url = 'https://api.dlocal.com'
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/d_local.rb - About 3 hrs to fix

            File world_net.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'nokogiri'
            
            module ActiveMerchant #:nodoc:
              module Billing #:nodoc:
                # See https://helpdesk.worldnettps.com/support/solutions/articles/1000167298-integrator-guide
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/world_net.rb - About 3 hrs to fix

              Class BridgePayGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class BridgePayGateway < Gateway
                    self.display_name = 'BridgePay'
                    self.homepage_url = 'http://www.bridgepaynetwork.com/'
              
                    self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/bridge_pay.rb - About 3 hrs to fix

                Class MerchantPartnersGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class MerchantPartnersGateway < Gateway
                      self.display_name = 'Merchant Partners'
                      self.homepage_url = 'http://www.merchantpartners.com/'
                
                      self.live_url = 'https://trans.merchantpartners.com/cgi-bin/ProcessXML.cgi'
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/merchant_partners.rb - About 3 hrs to fix

                  Class CreditcallGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class CreditcallGateway < Gateway
                        include Empty
                  
                        self.test_url = 'https://test.cardeasexml.com/generic.cex'
                        self.live_url = 'https://live.cardeasexml.com/generic.cex'
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/creditcall.rb - About 3 hrs to fix

                    Class WompiGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class WompiGateway < Gateway
                          self.test_url = 'https://sync.sandbox.wompi.co/v1'
                          self.live_url = 'https://sync.production.wompi.co/v1'
                    
                          self.supported_countries = ['CO']
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/wompi.rb - About 3 hrs to fix

                      Class AuthorizeNetArbGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class AuthorizeNetArbGateway < Gateway
                            API_VERSION = '3.1'
                      
                            self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
                            self.live_url = 'https://api.authorize.net/xml/v1/request.api'
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/authorize_net_arb.rb - About 3 hrs to fix

                        Class PagarmeGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class PagarmeGateway < Gateway
                              self.live_url = 'https://api.pagar.me/1/'
                        
                              self.supported_countries = ['BR']
                              self.default_currency = 'BRL'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/pagarme.rb - About 3 hrs to fix

                          Class NetbillingGateway has 26 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class NetbillingGateway < Gateway
                                self.live_url = self.test_url = 'https://secure.netbilling.com:1402/gw/sas/direct3.1'
                          
                                TRANSACTIONS = {
                                  authorization: 'A',
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/netbilling.rb - About 3 hrs to fix

                            File quickbooks.rb has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            module ActiveMerchant #:nodoc:
                              module Billing #:nodoc:
                                class QuickbooksGateway < Gateway
                                  self.test_url = 'https://sandbox.api.intuit.com'
                                  self.live_url = 'https://api.intuit.com'
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/quickbooks.rb - About 2 hrs to fix

                              Method add_recipient_data has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def add_recipient_data(post, options)
                                      return unless options[:recipient].is_a?(Hash)
                              
                                      recipient = options[:recipient]
                              
                              
                              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 parse_element has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def parse_element(reply, node)
                                      case node.name
                                      when 'CrossReferenceTransactionResult'
                                        reply[:transaction_result] = {}
                                        node.attributes.each do |a, b|
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/iridium.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_for_type has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def add_address_for_type(type, post, payment, address)
                                      prefix = address_key_prefix(type)
                                      first_name, last_name = split_names(address[:name])
                              
                                      post[address_key(prefix, 'fname')]    = first_name.blank? && last_name.blank? ? payment.first_name : first_name
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/usa_epay_transaction.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 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def add_address(xml, creditcard, options)
                                      return unless creditcard
                              
                                      if address = options[:billing_address] || options[:address]
                                        xml.tag!('CUSTOMER_BILL') do
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/secure_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

                              Severity
                              Category
                              Status
                              Source
                              Language