Showing 999 of 1,496 total issues
Class MoneiGateway
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class MoneiGateway < Gateway
self.live_url = self.test_url = 'https://api.monei.com/v1/payments'
self.supported_countries = %w[AD AT BE BG CA CH CY CZ DE DK EE ES FI FO FR GB GI GR HU IE IL IS IT LI LT LU LV MT NL NO PL PT RO SE SI SK TR US VA]
self.default_currency = 'EUR'
Class CenposGateway
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class CenposGateway < Gateway
self.display_name = 'CenPOS'
self.homepage_url = 'https://www.cenpos.com/'
self.live_url = 'https://ww3.cenpos.net/6/transact.asmx'
Class ElementGateway
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class ElementGateway < Gateway
self.test_url = 'https://certtransaction.elementexpress.com/express.asmx'
self.live_url = 'https://transaction.elementexpress.com/express.asmx'
self.supported_countries = ['US']
Method add_level_two_data
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def add_level_two_data(doc, payment_method, options = {})
level_2_data = options[:level_2_data]
if level_2_data
doc.enhancedData do
case payment_method.brand
- 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_credit_card
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def add_credit_card(xml, credit_card, address)
xml.tag! :Card do
# DataCash calls the CC number 'pan'
xml.tag! :pan, credit_card.number
xml.tag! :expirydate, format_date(credit_card.month, credit_card.year)
- 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 commerce_hub.rb
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class CommerceHubGateway < Gateway
self.test_url = 'https://connect-cert.fiservapps.com/ch'
self.live_url = 'https://prod.api.fiservapps.com/ch'
Class RedsysRestGateway
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class RedsysRestGateway < Gateway
self.test_url = 'https://sis-t.redsys.es:25443/sis/rest/'
self.live_url = 'https://sis.redsys.es/sis/rest/'
self.supported_countries = ['ES']
Class JetpayV2Gateway
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class JetpayV2Gateway < Gateway
self.test_url = 'https://test1.jetpay.com/jetpay'
self.live_url = 'https://gateway20.jetpay.com/jetpay'
self.money_format = :cents
Class PaymentezGateway
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class PaymentezGateway < Gateway #:nodoc:
self.test_url = 'https://ccapi-stg.paymentez.com/v2/'
self.live_url = 'https://ccapi.paymentez.com/v2/'
self.supported_countries = %w[MX EC CO BR CL PE]
Class MundipaggGateway
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class MundipaggGateway < Gateway
self.live_url = 'https://api.mundipagg.com/core/v1'
self.supported_countries = ['US']
self.default_currency = 'USD'
Class FlexChargeGateway
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class FlexChargeGateway < Gateway
self.test_url = 'https://api-sandbox.flex-charge.com/v1/'
self.live_url = 'https://api.flex-charge.com/v1/'
self.supported_countries = ['US']
Method add_auth_service
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def add_auth_service(xml, payment_method, options)
if network_tokenization?(payment_method)
if payment_method.source == :network_token
add_auth_network_tokenization(xml, payment_method, options)
else
- 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.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class SageGateway < Gateway
include Empty
File latitude19.rb
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class Latitude19Gateway < Gateway
self.display_name = 'Latitude19 Gateway'
self.homepage_url = 'http://www.l19tech.com'
Class IveriGateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class IveriGateway < Gateway
class_attribute :iveri_url
self.live_url = self.test_url = 'https://portal.nedsecure.co.za/iVeriWebService/Service.asmx'
self.iveri_url = 'https://portal.host.iveri.com/iVeriWebService/Service.asmx'
Class Shift4Gateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Shift4Gateway < Gateway
self.test_url = 'https://utgapi.shift4test.com/api/rest/v1/'
self.live_url = 'https://utg.shift4api.net/api/rest/v1/'
self.supported_countries = %w(US CA CU HT DO PR JM TT GP MQ BS BB LC CW AW VC VI GD AG DM KY KN SX TC MF VG BQ AI BL MS)
Class BarclaycardSmartpayGateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class BarclaycardSmartpayGateway < Gateway
self.test_url = 'https://pal-test.barclaycardsmartpay.com/pal/servlet'
self.live_url = 'https://pal-live.barclaycardsmartpay.com/pal/servlet'
self.supported_countries = %w[AL AD AM AT AZ BY BE BA BG HR CY CZ DK EE FI FR DE GR HU IS IE IT KZ LV LI LT LU MK MT MD MC ME NL NO PL PT RO RU SM RS SK SI ES SE CH TR UA GB VA]
Class IatsPaymentsGateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class IatsPaymentsGateway < Gateway
class_attribute :live_na_url, :live_uk_url
self.live_na_url = 'https://www.iatspayments.com/NetGate'
self.live_uk_url = 'https://www.uk.iatspayments.com/NetGate'
Class DecidirPlusGateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class DecidirPlusGateway < Gateway
self.test_url = 'https://developers.decidir.com/api/v2'
self.live_url = 'https://live.decidir.com/api/v2'
self.supported_countries = ['AR']
Class DeepstackGateway
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class DeepstackGateway < Gateway
self.test_url = 'https://api.sandbox.deepstack.io'
self.live_url = 'https://api.deepstack.io'
self.supported_countries = ['US']