activemerchant/active_merchant

View on GitHub

Showing 1,501 of 1,501 total issues

File priority.rb has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class PriorityGateway < Gateway
      # Sandbox and Production
      self.test_url = 'https://sandbox.api.mxmerchant.com/checkout/v3/payment'
Severity: Minor
Found in lib/active_merchant/billing/gateways/priority.rb - About 3 hrs to fix

    Method add_fraud_detection has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_fraud_detection(options = {})
            {}.tap do |hsh|
              hsh[:send_to_cs] = options[:send_to_cs] if valid_fraud_detection_option?(options[:send_to_cs]) # true/false
              hsh[:channel] = options[:channel] if valid_fraud_detection_option?(options[:channel])
              hsh[:dispatch_method] = options[:dispatch_method] if valid_fraud_detection_option?(options[:dispatch_method])
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/decidir.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_amount_by_country has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_amount_by_country(sum, options)
            if amount = options[:amount]
              sum[:subtotalIva] = amount[:subtotal_iva].to_f if amount[:subtotal_iva]
              sum[:iva] = amount[:iva].to_f if amount[:iva]
              sum[:subtotalIva0] = amount[:subtotal_iva_0].to_f if amount[:subtotal_iva_0]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/kushki.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 has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

          def add_billing(xml, billing)
            xml.tag!('v1:Billing') do
              xml.tag!('v1:CustomerID', billing[:customer_id]) if billing[:customer_id]
              xml.tag!('v1:Name', billing[:name]) if billing[:name]
              xml.tag!('v1:Company', billing[:company]) if billing[:company]
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/ipg.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 build_items has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

          def build_items(element, items)
            for item in items
              item_element = element.add_element('item')
              for key, value in item
                if key == :options
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/linkpoint.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 ebanx.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      File airwallex.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        File paymill.rb has 309 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module ActiveMerchant #:nodoc:
          module Billing #:nodoc:
            class PaymillGateway < Gateway
              self.supported_countries = %w(AD AT BE BG CH CY CZ DE DK EE ES FI FO FR GB
                                            GI GR HR HU IE IL IM IS IT LI LT LU LV MC MT
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/paymill.rb - About 3 hrs to fix

          File mercado_pago.rb has 308 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 usa_epay_transaction.rb has 307 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ActiveMerchant #:nodoc:
              module Billing #:nodoc:
                class UsaEpayTransactionGateway < Gateway
                  self.live_url = 'https://www.usaepay.com/gate'
                  self.test_url = 'https://sandbox.usaepay.com/gate'
            Severity: Minor
            Found in lib/active_merchant/billing/gateways/usa_epay_transaction.rb - About 3 hrs to fix

              Class Gateway has 28 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Gateway
                    include PostsData
                    include CreditCardFormatting
              
                    CREDIT_DEPRECATION_MESSAGE = 'Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead.'
              Severity: Minor
              Found in lib/active_merchant/billing/gateway.rb - About 3 hrs to fix

                Class NabTransactGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class NabTransactGateway < Gateway
                      API_VERSION = 'xml-4.2'
                      PERIODIC_API_VERSION = 'spxml-4.2'
                
                      class_attribute :test_periodic_url, :live_periodic_url
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/nab_transact.rb - About 3 hrs to fix

                  Class QuantumGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                      class QuantumGateway < Gateway
                        self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php'
                  
                        # visa, master, american_express, discover
                        self.supported_cardtypes = %i[visa master american_express discover]
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/quantum.rb - About 3 hrs to fix

                    Class WirecardGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class WirecardGateway < Gateway
                          self.test_url = 'https://c3-test.wirecard.com/secure/ssl-gateway'
                          self.live_url = 'https://c3.wirecard.com/secure/ssl-gateway'
                    
                          # The Namespaces are not really needed, because it just tells the System, that there's actually no namespace used.
                    Severity: Minor
                    Found in lib/active_merchant/billing/gateways/wirecard.rb - About 3 hrs to fix

                      Class QuickpayV4to7Gateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class QuickpayV4to7Gateway < Gateway
                            include QuickpayCommon
                            self.live_url = self.test_url = 'https://secure.quickpay.dk/api'
                            APPROVED = '000'
                      
                      
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb - About 3 hrs to fix

                        Class CulqiGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class CulqiGateway < Gateway
                              self.display_name = 'Culqi'
                              self.homepage_url = 'https://www.culqi.com'
                        
                              self.test_url = 'https://staging.paymentz.com/transaction/'
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/culqi.rb - About 3 hrs to fix

                          Class SafeChargeGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class SafeChargeGateway < Gateway
                                self.test_url = 'https://process.sandbox.safecharge.com/service.asmx/Process'
                                self.live_url = 'https://process.safecharge.com/service.asmx/Process'
                          
                                self.supported_countries = %w[AT BE BG CY CZ DE DK EE GR ES FI FR GI HK HR HU IE IS IT LI LT LU LV MT MX NL NO PL PT RO SE SG SI SK GB US]
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/safe_charge.rb - About 3 hrs to fix

                            Class EpayGateway has 28 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class EpayGateway < Gateway
                                  self.live_url = 'https://ssl.ditonlinebetalingssystem.dk/'
                            
                                  self.default_currency = 'DKK'
                                  self.money_format = :cents
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/epay.rb - About 3 hrs to fix

                              Method parameters has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    def parameters(money, creditcard, options = {})
                                      params = {
                                        payment: {
                                          subtotal: amount(options[:subtotal]),
                                          tax: amount(options[:tax]),
                              Severity: Major
                              Found in lib/active_merchant/billing/gateways/linkpoint.rb - About 3 hrs to fix

                                File flex_charge.rb has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                module ActiveMerchant #:nodoc:
                                  module Billing #:nodoc:
                                    class FlexChargeGateway < Gateway
                                      self.test_url = 'https://api-sandbox.flex-charge.com/v1/'
                                      self.live_url = 'https://api.flex-charge.com/v1/'
                                Severity: Minor
                                Found in lib/active_merchant/billing/gateways/flex_charge.rb - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language