Showing 999 of 1,496 total issues
File vantiv_express.rb
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
require 'securerandom'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
Class BlueSnapGateway
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
class BlueSnapGateway < Gateway
self.test_url = 'https://sandbox.bluesnap.com/services/2'
self.live_url = 'https://ws.bluesnap.com/services/2'
self.supported_countries = %w(US CA GB AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE AR BO BR BZ CL CO CR DO EC GF GP GT HN HT MF MQ MX NI PA PE PR PY SV UY VE)
File paypal_common_api.rb
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# This module is included in both PaypalGateway and PaypalExpressGateway
module PaypalCommonAPI
include Empty
Class PayeezyGateway
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class PayeezyGateway < Gateway
class_attribute :integration_url
self.test_url = 'https://api-cert.payeezy.com/v1'
self.integration_url = 'https://api-cat.payeezy.com/v1'
File credit_card_methods.rb
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'set'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# Convenience methods that can be included into a custom Credit Card object, such as an ActiveRecord based Credit Card object.
Method add_creditcard
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def add_creditcard(post, creditcard, options, use_sources = false)
card = {}
if emv_payment?(creditcard)
add_emv_creditcard(post, creditcard.icc_data)
post[:card][:read_method] = 'contactless' if creditcard.read_method == 'contactless'
- 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 46 (exceeds 5 allowed). Consider refactoring. Open
def add_address(xml, options)
if address = options[:billing_address] || options[:address]
address[:email] ||= options[:email]
xml.address do
xml.BillingAddress1 address[:address1] 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
Class FirstdataE4V27Gateway
has 50 methods (exceeds 20 allowed). Consider refactoring. Open
class FirstdataE4V27Gateway < Gateway
self.test_url = 'https://api.demo.globalgatewaye4.firstdata.com/transaction/v28'
self.live_url = 'https://api.globalgatewaye4.firstdata.com/transaction/v28'
TRANSACTIONS = {
Method add_payment_method
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def add_payment_method(post, payment_method, options, key = :source)
# the key = :destination when this method is called in def credit
post[key] = {}
case payment_method
when NetworkTokenizationCreditCard
- 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 LitleGateway
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class LitleGateway < Gateway
SCHEMA_VERSION = '9.14'
class_attribute :postlive_url, :prelive_url
Class GlobalCollectGateway
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class GlobalCollectGateway < Gateway
class_attribute :preproduction_url
class_attribute :ogone_direct_test
class_attribute :ogone_direct_live
Method parse_normal
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def parse_normal(action, body)
doc = Nokogiri::XML(body)
doc.remove_namespaces!
response = { action: action }
- 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 credorax.rb
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class CredoraxGateway < Gateway
class_attribute :test_url, :live_na_url, :live_eu_url
File eway_rapid.rb
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'json'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class EwayRapidGateway < Gateway
Class CyberSourceRestGateway
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class CyberSourceRestGateway < Gateway
include ActiveMerchant::Billing::CyberSourceCommon
self.test_url = 'https://apitest.cybersource.com'
self.live_url = 'https://api.cybersource.com'
Class RapydGateway
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class RapydGateway < Gateway
class_attribute :payment_redirect_test, :payment_redirect_live
self.test_url = 'https://sandboxapi.rapyd.net/v1/'
self.live_url = 'https://api.rapyd.net/v1/'
Class SagePayGateway
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class SagePayGateway < Gateway
cattr_accessor :simulate
self.simulate = false
class_attribute :simulator_url
Method add_paypal_details
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def add_paypal_details(xml, options)
xml.tag! 'PayPal' do
xml.tag! 'EMail', options[:email] unless options[:email].blank?
xml.tag! 'ReturnURL', options[:return_url] unless options[:return_url].blank?
xml.tag! 'CancelURL', options[:cancel_return_url] unless options[:cancel_return_url].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 build_merchant_data
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def build_merchant_data(xml, data, options = {})
# See https://sis-t.redsys.es:25443/sis/services/SerClsWSEntradaV2/wsdl/SerClsWSEntradaV2.wsdl
# (which results from calling #webservice_url + '?WSDL', https://sis-t.redsys.es:25443/sis/services/SerClsWSEntradaV2?WSDL)
xml.DATOSENTRADA do
# Basic elements
- 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 legacy_parse
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def legacy_parse(action, xml)
response = {}
error_messages = []
error_codes = []
- 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"