Showing 999 of 1,496 total issues
Class DecidirGateway
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class DecidirGateway < Gateway
self.test_url = 'https://developers.decidir.com/api/v2'
self.live_url = 'https://live.decidir.com/api/v2'
self.supported_countries = ['AR']
Class SkipJackGateway
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class SkipJackGateway < Gateway
API_VERSION = '?.?'
self.live_url = 'https://www.skipjackic.com'
self.test_url = 'https://developer.skipjackic.com'
Class SmartPs
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class SmartPs < Gateway #:nodoc:
##
# This is the base gateway for processors who use the smartPS processing system
self.abstract_class = true
Class TelrGateway
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class TelrGateway < Gateway
self.display_name = 'Telr'
self.homepage_url = 'http://www.telr.com/'
self.live_url = 'https://secure.telr.com/gateway/remote.xml'
File nmi.rb
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class NmiGateway < Gateway
include Empty
Method transaction_hash
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def transaction_hash(result)
unless result.success?
return { 'processor_response_code' => response_code_from_result(result),
'additional_processor_response' => additional_processor_response_from_result(result),
'payment_instrument_type' => payment_instrument_type(result.transaction),
Method parse_cim
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def parse_cim(body, options)
response = {}
doc = Nokogiri::XML(body).remove_namespaces!
- 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_request
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def build_request(action)
xml = Builder::XmlMarkup.new(encoding: 'UTF-8')
xml.instruct!(:xml, encoding: 'UTF-8')
xml.SOAP :Envelope, {
'xmlns:SOAP' => 'http://schemas.xmlsoap.org/soap/envelope/',
- 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_external_mpi_fields
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def add_external_mpi_fields(data, options)
return unless options[:three_d_secure]
if options[:three_d_secure][:version] == THREE_DS_V2
data[:threeDSServerTransID] = options[:three_d_secure][:three_ds_server_trans_id] if options[:three_d_secure][:three_ds_server_trans_id]
- 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 26 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(post, options)
if (address = (options[:billing_address] || options[:address]))
post[:billing_address] = {}
post[:billing_address][:street1] = address[:address1] if address[:address1]
post[:billing_address][:street2] = address[:address2] if address[:address2]
- 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_purchases_data
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def add_purchases_data(params, options)
return unless options[:purchases]
params['purchases'] = []
- 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 country.rb
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
class InvalidCountryCodeError < StandardError
end
class CountryCodeFormatError < StandardError
Class NuveiGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class NuveiGateway < Gateway
self.test_url = 'https://ppp-test.nuvei.com/ppp/api/v1'
self.live_url = 'https://secure.safecharge.com/ppp/api/v1'
self.supported_countries = %w[US CA IN NZ GB AU US]
Class VisanetPeruGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class VisanetPeruGateway < Gateway
include Empty
self.display_name = 'VisaNet Peru Gateway'
self.homepage_url = 'http://www.visanet.com.pe'
Class MercuryGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class MercuryGateway < Gateway
URLS = {
test: 'https://w1.mercurycert.net/ws/ws.asmx',
live: 'https://w1.mercurypay.com/ws/ws.asmx'
}
Class XpayGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class XpayGateway < Gateway
self.display_name = 'XPay Gateway'
self.homepage_url = 'https://developer.nexi.it/en'
self.test_url = 'https://xpaysandbox.nexigroup.com/api/phoenix-0.0/psp/api/v1/'
Class OmiseGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class OmiseGateway < Gateway
API_URL = 'https://api.omise.co/'
VAULT_URL = 'https://vault.omise.co/'
STANDARD_ERROR_CODE_MAPPING = {
Class MerchantWarriorGateway
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class MerchantWarriorGateway < Gateway
TOKEN_TEST_URL = 'https://base.merchantwarrior.com/token/'
TOKEN_LIVE_URL = 'https://api.merchantwarrior.com/token/'
POST_TEST_URL = 'https://base.merchantwarrior.com/post/'
File mundipagg.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class MundipaggGateway < Gateway
self.live_url = 'https://api.mundipagg.com/core/v1'
Method add_card_or_token_payment
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def add_card_or_token_payment(xml, card_or_token, options)
xml.hps :CardData do
if card_or_token.respond_to?(:number)
if card_or_token.track_data
xml.tag!('hps:TrackData', 'method' => 'swipe') do
- 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"