Showing 999 of 1,496 total issues
Method add_addresses
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def add_addresses(params, options)
address = options[:billing_address] || options[:address]
if address
params[:address1] = address[:address1] unless address[:address1].blank?
- 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 payeezy.rb
has 433 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant
module Billing
class PayeezyGateway < Gateway
class_attribute :integration_url
File elavon.rb
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_merchant/billing/gateways/viaklix'
require 'nokogiri'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
File iridium.rb
has 431 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# For more information on the Iridium Gateway please download the
# documentation from their Merchant Management System.
#
Method add_transaction
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def add_transaction(xml, transaction)
raise StandardError, "Invalid Customer Information Manager Transaction Type: #{transaction[:type]}" unless CIM_TRANSACTION_TYPES.include?(transaction[:type])
xml.tag!('transaction') do
xml.tag!(CIM_TRANSACTION_TYPES[transaction[:type]]) 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 RedsysGateway
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class RedsysGateway < Gateway
self.live_url = 'https://sis.redsys.es/sis/operaciones'
self.test_url = 'https://sis-t.redsys.es:25443/sis/operaciones'
self.supported_countries = %w[ES FR GB IT PL PT]
Class ElavonGateway
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
class ElavonGateway < Gateway
include Empty
class_attribute :test_url, :live_url, :delimiter, :actions
Class FirstdataE4Gateway
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class FirstdataE4Gateway < Gateway
# TransArmor support requires v11 or lower
self.test_url = 'https://api.demo.globalgatewaye4.firstdata.com/transaction/v11'
self.live_url = 'https://api.globalgatewaye4.firstdata.com/transaction/v11'
Class PaysafeGateway
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class PaysafeGateway < Gateway
self.test_url = 'https://api.test.paysafe.com'
self.live_url = 'https://api.paysafe.com'
self.supported_countries = %w(AL AT BE BA BG CA HR CY CZ DK EE FI FR DE GR HU IS IE IT LV LI LT LU MT ME NL MK NO PL PT RO RS SK SI ES SE CH TR GB US)
Class PayuLatamGateway
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class PayuLatamGateway < Gateway
self.display_name = 'PayU Latam'
self.homepage_url = 'http://www.payulatam.com'
self.test_url = 'https://sandbox.api.payulatam.com/payments-api/4.0/service.cgi'
Class PriorityGateway
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class PriorityGateway < Gateway
# Sandbox and Production
self.test_url = 'https://sandbox.api.mxmerchant.com/checkout/v3/payment'
self.live_url = 'https://api.mxmerchant.com/checkout/v3/payment'
Method build_authorization_request
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def build_authorization_request(money, payment_method, options)
build_request do |xml|
xml.submit do
xml.order order_tag_attributes(options) do
xml.description(options[:description].blank? ? 'Purchase' : options[:description])
- 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_address
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def add_address(xml, tag, address, options)
return if address.nil?
xml.tag! tag do
xml.tag! 'Name', address[:name] unless address[:name].blank?
- 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 payu_latam.rb
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'digest/md5'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PayuLatamGateway < Gateway
Class TransFirstTransactionExpressGateway
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class TransFirstTransactionExpressGateway < Gateway
self.display_name = 'TransFirst Transaction Express'
self.homepage_url = 'http://transactionexpress.com/'
self.test_url = 'https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl'
File firstdata_e4_v27.rb
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class FirstdataE4V27Gateway < Gateway
self.test_url = 'https://api.demo.globalgatewaye4.firstdata.com/transaction/v28'
self.live_url = 'https://api.globalgatewaye4.firstdata.com/transaction/v28'
Method add_flight_legs
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def add_flight_legs(airline_options)
flight_legs = []
airline_options[:flight_legs]&.each do |fl|
leg = {}
leg['airlineClass'] = fl[:airline_class] if fl[:airline_class]
- 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 build_customer_request_xml
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def build_customer_request_xml(credit_card, options = {})
ActiveMerchant.deprecated 'Customer Profile support in Orbital is non-conformant to the ActiveMerchant API and will be removed in its current form in a future version. Please contact the ActiveMerchant maintainers if you have an interest in modifying it to conform to the store/unstore/update API.'
xml = xml_envelope
xml.tag! :Request do
xml.tag! :Profile 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 sage_pay.rb
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class SagePayGateway < Gateway
cattr_accessor :simulate
self.simulate = false
File cyber_source_rest.rb
has 406 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