Showing 992 of 1,478 total issues
Method create_setup_intent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def create_setup_intent(payment_method, options = {})
MultiResponse.run do |r|
r.process do
post = {}
add_customer(post, options)
- 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_aggregate_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_aggregate_data(post, options)
aggregate_data = {}
data = options[:aggregate_data]
aggregate_data[:indicator] = data[:indicator] if data[:indicator]
aggregate_data[:identification_number] = data[:identification_number] if data[:identification_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"
Further reading
Method add_billing_address
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(post, type, options)
if address = (options[:billing_address] || options[:address])
billing = {}
address = options[:billing_address] || options[:address]
billing[:street] = address[:address1].match(/\D+/)[0].strip if address[:address1]
- 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_transaction_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def add_transaction_data(trans_type, post, money, options)
currency = options[:currency] || currency(money)
post[:sg_TransType] = trans_type
post[:sg_Currency] = currency
- 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 validate_essential_attributes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def validate_essential_attributes #:nodoc:
errors = []
if self.class.requires_name?
errors << [:first_name, 'cannot be empty'] if first_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
Method parse_normal
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_normal(action, body)
doc = Nokogiri::XML(body)
doc.remove_namespaces!
response = { action: action }
Class PaywayDotComGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class PaywayDotComGateway < Gateway
self.test_url = 'https://paywaywsdev.com/PaywayWS/Payment/CreditCard'
self.live_url = 'https://paywayws.net/PaywayWS/Payment/CreditCard'
self.supported_countries = %w[US CA]
Class VposGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class VposGateway < Gateway
self.test_url = 'https://vpos.infonet.com.py:8888'
self.live_url = 'https://vpos.infonet.com.py'
self.supported_countries = ['PY']
Class IridiumGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class IridiumGateway < Gateway
self.live_url = self.test_url = 'https://gw1.iridiumcorp.net/'
# The countries the gateway supports merchants from as 2 digit ISO country codes
self.supported_countries = %w[GB ES]
Class CC5Gateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class CC5Gateway < Gateway
self.default_currency = 'TRY'
CURRENCY_CODES = {
'TRY' => 949,
Class CamsGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class CamsGateway < Gateway
self.live_url = 'https://secure.centralams.com/gw/api/transact.php'
self.supported_countries = ['US']
self.default_currency = 'USD'
Class CheckoutGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class CheckoutGateway < Gateway
self.default_currency = 'USD'
self.money_format = :cents
self.supported_countries = %w[AD AT BE BG CH CY CZ DE DK EE ES FO FI FR GB GI GL GR HR HU IE IS IL IT LI LT LU LV MC MT NL NO PL PT RO SE SI SM SK SJ TR VA]
Class InspireGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class InspireGateway < Gateway
self.live_url = self.test_url = 'https://secure.inspiregateway.net/api/transact.php'
self.supported_countries = ['US']
self.supported_cardtypes = %i[visa master american_express]
Class MitGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class MitGateway < Gateway
self.live_url = 'https://wpy.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
self.test_url = 'https://scqa.mitec.com.mx/ModuloUtilWS/activeCDP.htm'
self.supported_countries = ['MX']
Class WepayGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class WepayGateway < Gateway
self.test_url = 'https://stage.wepayapi.com/v2'
self.live_url = 'https://wepayapi.com/v2'
self.supported_countries = %w[US CA]
Class ModernPaymentsCimGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ModernPaymentsCimGateway < Gateway #:nodoc:
self.test_url = 'https://secure.modpay.com/netservices/test/ModpayTest.asmx'
self.live_url = 'https://secure.modpay.com/ws/modpay.asmx'
LIVE_XMLNS = 'https://secure.modpay.com/ws/'
Class ItransactGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ItransactGateway < Gateway
self.live_url = self.test_url = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltrans2.cgi'
# The countries the gateway supports merchants from as 2 digit ISO country codes
self.supported_countries = ['US']
Class SoEasyPayGateway
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class SoEasyPayGateway < Gateway
self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
self.money_format = :cents
self.supported_countries = %w[
File data_cash.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/string/access'
module ActiveMerchant
module Billing
class DataCashGateway < Gateway
File plexo.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PlexoGateway < Gateway
self.test_url = 'https://api.testing.plexo.com.uy/v1/payments'
self.live_url = 'https://api.plexo.com.uy/v1/payments'