Showing 992 of 1,478 total issues
Method build_setup_request
has 68 lines of code (exceeds 25 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]
File decidir_plus.rb
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class DecidirPlusGateway < Gateway
self.test_url = 'https://developers.decidir.com/api/v2'
self.live_url = 'https://live.decidir.com/api/v2'
File shift4.rb
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class Shift4Gateway < Gateway
self.test_url = 'https://utgapi.shift4test.com/api/rest/v1/'
self.live_url = 'https://utg.shift4api.net/api/rest/v1/'
File cardknox.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class CardknoxGateway < Gateway
self.live_url = 'https://x1.cardknox.com/gateway'
Class ExactGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ExactGateway < Gateway
self.live_url = self.test_url = 'https://secure2.e-xact.com/vplug-in/transaction/rpc-enc/service.asmx'
API_VERSION = '8.5'
Class FatZebraGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class FatZebraGateway < Gateway
self.live_url = 'https://gateway.fatzebra.com.au/v1.0'
self.test_url = 'https://gateway.sandbox.fatzebra.com.au/v1.0'
self.supported_countries = ['AU']
Class SumUpGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class SumUpGateway < Gateway
self.live_url = 'https://api.sumup.com/v0.1/'
self.supported_countries = %w(AT BE BG BR CH CL CO CY CZ DE DK EE ES FI FR
GB GR HR HU IE IT LT LU LV MT NL NO PL PT RO
Class TransFirstGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class TransFirstGateway < Gateway
self.test_url = 'https://ws.cert.transfirst.com'
self.live_url = 'https://webservices.primerchants.com'
self.supported_countries = ['US']
Class PaystationGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class PaystationGateway < Gateway
self.live_url = self.test_url = 'https://www.paystation.co.nz/direct/paystation.dll'
# an "error code" of "0" means "No error - transaction successful"
SUCCESSFUL_RESPONSE_CODE = '0'
Class AleloGateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class AleloGateway < Gateway
class_attribute :prelive_url
self.test_url = 'https://sandbox-api.alelo.com.br/alelo/sandbox/'
self.live_url = 'https://api.alelo.com.br/alelo/prd/'
Class PayJunctionV2Gateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class PayJunctionV2Gateway < Gateway
self.display_name = 'PayJunction'
self.homepage_url = 'https://www.payjunction.com/'
self.test_url = 'https://api.payjunctionlabs.com/transactions'
Method add_3ds
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_3ds(post, options)
if options[:three_d_secure] || options[:execute_threed]
post[:'3ds'] = {}
post[:'3ds'][:enabled] = true
post[:success_url] = options[:callback_url] if options[:callback_url]
- 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_shipping_address
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_shipping_address(post, options)
if address = options[:shipping_address]
post[:shipping] = {}
post[:shipping][:address] = {}
post[:shipping][:address][:address_line1] = 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
Method add_billing_address
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(post, payment, options)
post[:billing_address] = {}
if address = options[:billing_address] || options[:address]
first_name, last_name = split_names(address[:name])
post[:billing_address][:first_name] = first_name if first_name
- 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_settings
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_settings(xml, source, options)
xml.transactionSettings do
if options[:recurring] || subsequent_recurring_transaction?(options)
xml.setting do
xml.settingName('recurringBilling')
- 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_3ds
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_3ds(post, options)
if three_ds_2_options = options[:three_ds_2]
device_channel = three_ds_2_options[:channel]
if device_channel == 'app'
post[:threeDS2RequestData] = { deviceChannel: device_channel }
- 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_source_owner
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_source_owner(post, creditcard, options)
post[:owner] = {}
post[:owner][:name] = creditcard.name if creditcard.respond_to?(:name) && creditcard.name
post[:owner][:email] = options[:email] if options[:email]
- 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 verify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def verify(creditcard, options = {})
if options[:allow_card_verification] == true
options.delete(:allow_card_verification)
exp_month = creditcard.month.to_s
exp_year = creditcard.year.to_s
- 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_additional_data
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_additional_data(params, options)
params['isAuth'] = options[:is_auth].present? ? options[:is_auth] : 'true'
params['paymentType'] = options[:payment_type].present? ? options[:payment_type] : 'Sale'
params['tenderType'] = options[:tender_type].present? ? options[:tender_type] : 'Card'
params['taxExempt'] = options[:tax_exempt].present? ? options[:tax_exempt] : 'false'
- 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_buyer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_buyer(post, payment_method, options)
buyer = {}
if buyer_hash = options[:buyer]
buyer[:fullName] = buyer_hash[:name]
buyer[:dniNumber] = buyer_hash[:dni_number]
- 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"