activemerchant/active_merchant

View on GitHub

Showing 992 of 1,478 total issues

Method create_setup_intent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def create_setup_intent(payment_method, options = {})
        MultiResponse.run do |r|
          r.process do
            post = {}
            add_customer(post, options)
Severity: Minor
Found in lib/active_merchant/billing/gateways/stripe_payment_intents.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_aggregate_data has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def add_aggregate_data(post, options)
        aggregate_data = {}
        data = options[:aggregate_data]
        aggregate_data[:indicator] = data[:indicator] if data[:indicator]
        aggregate_data[:identification_number] = data[:identification_number] if data[:identification_number]
Severity: Minor
Found in lib/active_merchant/billing/gateways/decidir.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 17 (exceeds 5 allowed). Consider refactoring.
Open

      def add_billing_address(post, type, options)
        if address = (options[:billing_address] || options[:address])
          billing = {}
          address = options[:billing_address] || options[:address]
          billing[:street] = address[:address1].match(/\D+/)[0].strip if address[:address1]
Severity: Minor
Found in lib/active_merchant/billing/gateways/mundipagg.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_transaction_data has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def add_transaction_data(trans_type, post, money, options)
        currency = options[:currency] || currency(money)

        post[:sg_TransType] = trans_type
        post[:sg_Currency] = currency
Severity: Minor
Found in lib/active_merchant/billing/gateways/safe_charge.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 validate_essential_attributes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def validate_essential_attributes #:nodoc:
        errors = []

        if self.class.requires_name?
          errors << [:first_name, 'cannot be empty'] if first_name.blank?
Severity: Minor
Found in lib/active_merchant/billing/credit_card.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_normal has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def parse_normal(action, body)
        doc = Nokogiri::XML(body)
        doc.remove_namespaces!

        response = { action: action }
Severity: Major
Found in lib/active_merchant/billing/gateways/authorize_net.rb - About 2 hrs to fix

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

        class PaywayDotComGateway < Gateway
          self.test_url = 'https://paywaywsdev.com/PaywayWS/Payment/CreditCard'
          self.live_url = 'https://paywayws.net/PaywayWS/Payment/CreditCard'
    
          self.supported_countries = %w[US CA]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/payway_dot_com.rb - About 2 hrs to fix

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

          class VposGateway < Gateway
            self.test_url = 'https://vpos.infonet.com.py:8888'
            self.live_url = 'https://vpos.infonet.com.py'
      
            self.supported_countries = ['PY']
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/vpos.rb - About 2 hrs to fix

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

            class IridiumGateway < Gateway
              self.live_url = self.test_url = 'https://gw1.iridiumcorp.net/'
        
              # The countries the gateway supports merchants from as 2 digit ISO country codes
              self.supported_countries = %w[GB ES]
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/iridium.rb - About 2 hrs to fix

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

              class CC5Gateway < Gateway
                self.default_currency = 'TRY'
          
                CURRENCY_CODES = {
                  'TRY' => 949,
          Severity: Minor
          Found in lib/active_merchant/billing/gateways/cc5.rb - About 2 hrs to fix

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

                class CamsGateway < Gateway
                  self.live_url = 'https://secure.centralams.com/gw/api/transact.php'
            
                  self.supported_countries = ['US']
                  self.default_currency = 'USD'
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/cams.rb - About 2 hrs to fix

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

                  class CheckoutGateway < Gateway
                    self.default_currency = 'USD'
                    self.money_format = :cents
              
                    self.supported_countries = %w[AD AT BE BG CH CY CZ DE DK EE ES FO FI FR GB GI GL GR HR HU IE IS IL IT LI LT LU LV MC MT NL NO PL PT RO SE SI SM SK SJ TR VA]
              Severity: Minor
              Found in lib/active_merchant/billing/gateways/checkout.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 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 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 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

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

                              module ActiveMerchant #:nodoc:
                                module Billing #:nodoc:
                                  class PlexoGateway < Gateway
                                    self.test_url = 'https://api.testing.plexo.com.uy/v1/payments'
                                    self.live_url = 'https://api.plexo.com.uy/v1/payments'
                              Severity: Minor
                              Found in lib/active_merchant/billing/gateways/plexo.rb - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language