Showing 1,493 of 1,493 total issues
File cyber_source.rb
has 1040 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# Initial setup instructions can be found in
# http://apps.cybersource.com/library/documentation/dev_guides/SOAP_Toolkits/SOAP_toolkits.pdf
#
Method build_setup_request
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
def build_setup_request(action, money, options)
currency_code = options[:currency] || currency(money)
options[:payment_action] = action
options[:express_request] = true
options[:shipping_address] ||= options[:address]
- Read upRead up
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 authorize_net.rb
has 984 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
module ActiveMerchant
module Billing
class AuthorizeNetGateway < Gateway
File orbital.rb
has 968 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_merchant/billing/gateways/orbital/orbital_soft_descriptors'
require 'rexml/document'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
File worldpay.rb
has 927 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class WorldpayGateway < Gateway
File braintree_blue.rb
has 920 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_merchant/billing/gateways/braintree/braintree_common'
require 'active_merchant/billing/gateways/braintree/token_nonce'
require 'active_support/core_ext/array/extract_options'
begin
Method build_recurring_request
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
def build_recurring_request(action, money, options)
raise StandardError, "Invalid Recurring Profile Action: #{action}" unless RECURRING_ACTIONS.include?(action)
xml = Builder::XmlMarkup.new
xml.tag! 'RecurringProfiles' do
- Read upRead up
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 usa_epay_advanced.rb
has 842 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'securerandom'
require 'digest'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
Class CyberSourceGateway
has 105 methods (exceeds 20 allowed). Consider refactoring. Open
class CyberSourceGateway < Gateway
self.test_url = 'https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor'
self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
# Schema files can be found here: https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/
Class WorldpayGateway
has 104 methods (exceeds 20 allowed). Consider refactoring. Open
class WorldpayGateway < Gateway
self.test_url = 'https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp'
self.live_url = 'https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp'
self.default_currency = 'GBP'
File adyen.rb
has 825 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class AdyenGateway < Gateway
# we recommend setting up merchant-specific endpoints.
# https://docs.adyen.com/developers/api-manual#apiendpoints
Class OrbitalGateway
has 99 methods (exceeds 20 allowed). Consider refactoring. Open
class OrbitalGateway < Gateway
include Empty
API_VERSION = '9.5'
Method build_create_profile_request
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def build_create_profile_request(options)
xml = Builder::XmlMarkup.new :indent => 2
xml.tag! 'CreateRecurringPaymentsProfileReq', 'xmlns' => PAYPAL_NAMESPACE do
xml.tag! 'CreateRecurringPaymentsProfileRequest', 'xmlns:n2' => EBAY_NAMESPACE do
xml.tag! 'n2:Version', API_VERSION
- Read upRead up
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
Class UsaEpayAdvancedGateway
has 90 methods (exceeds 20 allowed). Consider refactoring. Open
class UsaEpayAdvancedGateway < Gateway
API_VERSION = '1.4'
TEST_URL_BASE = 'https://sandbox.usaepay.com/soap/gate/' #:nodoc:
LIVE_URL_BASE = 'https://www.usaepay.com/soap/gate/' #:nodoc:
File stripe.rb
has 735 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/hash/slice'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# This gateway uses an older version of the Stripe API.
Method build_credit_card_request
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
def build_credit_card_request(action, money, credit_card, options)
xml = Builder::XmlMarkup.new
xml.tag! TRANSACTIONS[action] do
xml.tag! 'PayData' do
xml.tag! 'Invoice' do
- Read upRead up
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
Class AuthorizeNetGateway
has 79 methods (exceeds 20 allowed). Consider refactoring. Open
class AuthorizeNetGateway < Gateway
include Empty
self.test_url = 'https://apitest.authorize.net/xml/v1/request.api'
self.live_url = 'https://api2.authorize.net/xml/v1/request.api'
Class AdyenGateway
has 78 methods (exceeds 20 allowed). Consider refactoring. Open
class AdyenGateway < Gateway
# we recommend setting up merchant-specific endpoints.
# https://docs.adyen.com/developers/api-manual#apiendpoints
self.test_url = 'https://pal-test.adyen.com/pal/servlet/'
self.live_url = 'https://pal-live.adyen.com/pal/servlet/'
Method add_contact
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def add_contact(doc, fullname, options)
doc['v1'].contact do
doc['v1'].fullName fullname unless fullname.blank?
doc['v1'].coName options[:company_name] if options[:company_name]
doc['v1'].title options[:title] if options[:title]
- Read upRead up
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_lodging
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def add_lodging(xml, options)
if lodging = options[:lodging]
xml.extendedParameters do
xml.ExtendedParameters do
xml.Key 'Lodging'
- Read upRead up
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"