activemerchant/active_merchant

View on GitHub

Showing 1,478 of 1,478 total issues

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

              File ebanx.rb has 288 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 2 hrs to fix

                File pro_pay.rb has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'nokogiri'
                
                module ActiveMerchant #:nodoc:
                  module Billing #:nodoc:
                    class ProPayGateway < Gateway
                Severity: Minor
                Found in lib/active_merchant/billing/gateways/pro_pay.rb - About 2 hrs to fix

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

                          if address = recipient[:address]
                            address1 = address[:address1] || address[:address_line1]
                            address2 = address[:address2] || address[:address_line2]
                  
                            post[:recipient][:address] = {}
                  Severity: Major
                  Found in lib/active_merchant/billing/gateways/checkout_v2.rb and 1 other location - About 2 hrs to fix
                  lib/active_merchant/billing/gateways/checkout_v2.rb on lines 207..217

                  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 104.

                  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

                          if address = sender[:address]
                            address1 = address[:address1] || address[:address_line1]
                            address2 = address[:address2] || address[:address_line2]
                  
                            post[:sender][:address] = {}
                  Severity: Major
                  Found in lib/active_merchant/billing/gateways/checkout_v2.rb and 1 other location - About 2 hrs to fix
                  lib/active_merchant/billing/gateways/checkout_v2.rb on lines 174..184

                  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 104.

                  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 mercury.rb has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module ActiveMerchant #:nodoc:
                    module Billing #:nodoc:
                      # The Mercury gateway integration by default requires that the Mercury
                      # account being used has tokenization turned. This enables the use of
                      # capture/refund/void without having to pass the credit card back in each
                  Severity: Minor
                  Found in lib/active_merchant/billing/gateways/mercury.rb - About 2 hrs to fix

                    Class SecurePayAuGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                    Open

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

                      Class BorgunGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class BorgunGateway < Gateway
                            self.display_name = 'Borgun'
                            self.homepage_url = 'http://www.borgun.com'
                      
                            self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
                      Severity: Minor
                      Found in lib/active_merchant/billing/gateways/borgun.rb - About 2 hrs to fix

                        Class GarantiGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class GarantiGateway < Gateway
                              self.live_url = 'https://sanalposprov.garanti.com.tr/VPServlet'
                              self.test_url = 'https://sanalposprovtest.garanti.com.tr/VPServlet'
                        
                              # The countries the gateway supports merchants from as 2 digit ISO country codes
                        Severity: Minor
                        Found in lib/active_merchant/billing/gateways/garanti.rb - About 2 hrs to fix

                          Class PayexGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class PayexGateway < Gateway
                                class_attribute :live_external_url, :test_external_url, :live_confined_url, :test_confined_url
                          
                                self.live_external_url = 'https://external.payex.com/'
                                self.test_external_url = 'https://test-external.payex.com/'
                          Severity: Minor
                          Found in lib/active_merchant/billing/gateways/payex.rb - About 2 hrs to fix

                            Class PayArcGateway has 25 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                class PayArcGateway < Gateway
                                  self.test_url = 'https://testapi.payarc.net/v1'
                                  self.live_url = 'https://api.payarc.net/v1'
                            
                                  self.supported_countries = ['US']
                            Severity: Minor
                            Found in lib/active_merchant/billing/gateways/pay_arc.rb - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language