activemerchant/active_merchant

View on GitHub
lib/active_merchant/billing/gateways/cyber_source_rest.rb

Summary

Maintainability
C
1 day
Test Coverage

Class CyberSourceRestGateway has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

    class CyberSourceRestGateway < Gateway
      include ActiveMerchant::Billing::CyberSourceCommon

      self.test_url = 'https://apitest.cybersource.com'
      self.live_url = 'https://api.cybersource.com'
Severity: Minor
Found in lib/active_merchant/billing/gateways/cyber_source_rest.rb - About 6 hrs to fix

    File cyber_source_rest.rb has 368 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'active_merchant/billing/gateways/cyber_source/cyber_source_common'
    
    module ActiveMerchant #:nodoc:
      module Billing #:nodoc:
        class CyberSourceRestGateway < Gateway
    Severity: Minor
    Found in lib/active_merchant/billing/gateways/cyber_source_rest.rb - About 4 hrs to fix

      Method add_address has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def add_address(post, payment_method, address, options, address_type)
      Severity: Minor
      Found in lib/active_merchant/billing/gateways/cyber_source_rest.rb - About 35 mins to fix

        Method add_merchant_description has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def add_merchant_description(post, options)
                return unless options[:merchant_descriptor_name] || options[:merchant_descriptor_address1] || options[:merchant_descriptor_locality]
        
                merchant = post[:merchantInformation][:merchantDescriptor] = {}
                merchant[:name] = options[:merchant_descriptor_name] if options[:merchant_descriptor_name]
        Severity: Minor
        Found in lib/active_merchant/billing/gateways/cyber_source_rest.rb - About 25 mins 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

        There are no issues that match your filters.

        Category
        Status