Showing 999 of 1,496 total issues
Method add_customer
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def add_customer(request, payment_method, options)
address = options[:billing_address] || options[:address]
request[:customer] = {}
request[:customer][:email] = options[:email] || 'support@monei.net'
- 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 paymentez.rb
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'base64'
require 'digest'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
Class UsaEpayTransactionGateway
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class UsaEpayTransactionGateway < Gateway
self.live_url = 'https://www.usaepay.com/gate'
self.test_url = 'https://sandbox.usaepay.com/gate'
self.supported_cardtypes = %i[visa master american_express]
Class JetpayGateway
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class JetpayGateway < Gateway
class_attribute :live_us_url, :live_ca_url
self.test_url = 'https://test1.jetpay.com/jetpay'
self.live_us_url = 'https://gateway17.jetpay.com/jetpay'
Class CardStreamGateway
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class CardStreamGateway < Gateway
THREEDSECURE_REQUIRED_DEPRECATION_MESSAGE = 'Specifying the :threeDSRequired initialization option is deprecated. Please use the `:threeds_required => true` *transaction* option instead.'
self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/'
self.money_format = :cents
Class SpreedlyCoreGateway
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class SpreedlyCoreGateway < Gateway
self.live_url = 'https://core.spreedly.com/v1'
self.supported_countries = %w(AD AE AT AU BD BE BG BN CA CH CY CZ DE DK EE EG ES FI FR GB
GI GR HK HU ID IE IL IM IN IS IT JO KW LB LI LK LT LU LV MC
Class MigsGateway
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class MigsGateway < Gateway
include MigsCodes
API_VERSION = 1
File simetrik.rb
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class SimetrikGateway < Gateway
self.test_url = 'https://payments.sta.simetrik.com/v1'
self.live_url = 'https://payments.simetrik.com/v1'
File trust_commerce.rb
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
begin
require 'tclink'
rescue LoadError
# Falls back to an SSL post to TrustCommerce
end
File priority.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PriorityGateway < Gateway
# Sandbox and Production
self.test_url = 'https://sandbox.api.mxmerchant.com/checkout/v3/payment'
Method add_fraud_detection
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def add_fraud_detection(options = {})
{}.tap do |hsh|
hsh[:send_to_cs] = options[:send_to_cs] if valid_fraud_detection_option?(options[:send_to_cs]) # true/false
hsh[:channel] = options[:channel] if valid_fraud_detection_option?(options[:channel])
hsh[:dispatch_method] = options[:dispatch_method] if valid_fraud_detection_option?(options[:dispatch_method])
- 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
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def add_billing(xml, billing)
xml.tag!('v1:Billing') do
xml.tag!('v1:CustomerID', billing[:customer_id]) if billing[:customer_id]
xml.tag!('v1:Name', billing[:name]) if billing[:name]
xml.tag!('v1:Company', billing[:company]) if billing[:company]
- 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_amount_by_country
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def add_amount_by_country(sum, options)
if amount = options[:amount]
sum[:subtotalIva] = amount[:subtotal_iva].to_f if amount[:subtotal_iva]
sum[:iva] = amount[:iva].to_f if amount[:iva]
sum[:subtotalIva0] = amount[:subtotal_iva_0].to_f if amount[:subtotal_iva_0]
- 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_items
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def build_items(element, items)
for item in items
item_element = element.add_element('item')
for key, value in item
if key == :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
File paymill.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PaymillGateway < Gateway
self.supported_countries = %w(AD AT BE BG CH CY CZ DE DK EE ES FI FO FR GB
GI GR HR HU IE IL IM IS IT LI LT LU LV MC MT
File airwallex.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class AirwallexGateway < Gateway
self.test_url = 'https://api-demo.airwallex.com/api/v1'
self.live_url = 'https://pci-api.airwallex.com/api/v1'
File mercado_pago.rb
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class MercadoPagoGateway < Gateway
self.live_url = self.test_url = 'https://api.mercadopago.com/v1'
File usa_epay_transaction.rb
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class UsaEpayTransactionGateway < Gateway
self.live_url = 'https://www.usaepay.com/gate'
self.test_url = 'https://sandbox.usaepay.com/gate'
Class NabTransactGateway
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class NabTransactGateway < Gateway
API_VERSION = 'xml-4.2'
PERIODIC_API_VERSION = 'spxml-4.2'
class_attribute :test_periodic_url, :live_periodic_url
Class Gateway
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Gateway
include PostsData
include CreditCardFormatting
CREDIT_DEPRECATION_MESSAGE = 'Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead.'