Showing 1,005 of 1,501 total issues
Method add_billing_address
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(xml, creditcard, options)
address = options[:billing_address]
return unless address
xml.billing 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"
Further reading
Method add_shipping
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def add_shipping(xml, shipping)
xml.tag!('v1:Shipping') do
xml.tag!('v1:Type', shipping[:type]) if shipping[:type]
xml.tag!('v1:Name', shipping[:name]) if shipping[:name]
xml.tag!('v1:Address1', shipping[:address_1]) if shipping[:address_1]
- 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_direct_response
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_direct_response(params)
delimiter = @options[:delimiter] || ','
direct_response = { 'raw' => params }
direct_response_fields = params.split(delimiter)
direct_response.merge(
File vanco.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
module ActiveMerchant
module Billing
class VancoGateway < Gateway
File ixopay.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'nokogiri'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class IxopayGateway < Gateway
Method parameters
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parameters(money, creditcard, options = {})
params = {
# General order parameters
StoreID: @options[:login],
Passphrase: @options[:password],
File cecabank_json.rb
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_merchant/billing/gateways/cecabank/cecabank_common'
module ActiveMerchant
module Billing
class CecabankJsonGateway < Gateway
Method parse_direct_response_elements
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_direct_response_elements(response, options)
params = response[:direct_response]&.tr('"', '')
return {} unless params
parts = params.split(options[:delimiter] || ',')
Method commit
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def commit(method, url, parameters = nil, options = {}, type = false)
raw_response = response = nil
success = false
begin
json = parameters ? parameters.to_json : nil
Method add_mpi_3ds
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_mpi_3ds(xml, three_d_secure_options)
# structure as per https://developer.paypal.com/api/nvp-soap/payflow/3d-secure-mpi/
authentication_id = three_d_secure_options[:authentication_id]
authentication_status = three_d_secure_options[:authentication_response_status]
- 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_and_customer_info
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_address_and_customer_info(xml, options)
billing_address = options[:billing_address] || options[:address]
shipping_address = options[:shipping_address]
ipv4_address = ipv4?(options[:ip]) ? options[:ip] : nil
- 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 post_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def post_data(params)
return nil unless params
params.map do |key, value|
next if value.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 add_stored_credentials_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credentials_data(post, options)
return unless @protocol_version == '4.00'
return unless stored_credential = options[:stored_credential]
initiator = stored_credential[:initiator] == 'cardholder' ? 'CIT' : 'MIT'
- 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_fraud_parameters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_fraud_parameters(post, options)
if @protocol >= 4
post[:fraud_remote_addr] = options[:ip] if options[:ip]
post[:fraud_http_accept] = options[:fraud_http_accept] if options[:fraud_http_accept]
post[:fraud_http_accept_language] = options[:fraud_http_accept_language] if options[:fraud_http_accept_language]
- 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_profile
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_profile(xml, profile, update = false)
xml.tag!('profile') do
# Merchant assigned ID for the customer. Up to 20 characters. (optional)
xml.tag!('merchantCustomerId', profile[:merchant_customer_id]) if profile[:merchant_customer_id]
# Description of the customer. Up to 255 Characters (optional)
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def add_address(post, options)
return unless post[:card]&.kind_of?(Hash)
if address = options[:billing_address]
post[:card][:addressLine1] = 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
Method add_splits
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_splits(post, options)
return unless split_data = options[:splits]
splits = []
split_data.each do |split|
- 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_shipping_address
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_shipping_address(xml, options, root_node = 'shipTo')
address = options[:shipping_address] || options[:address]
return unless address
xml.send(root_node) 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"
Further reading
Method add_network_tokenization_card
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_network_tokenization_card(post, payment, options)
selected_brand = NETWORK_TOKENIZATION_CARD_SOURCE[options[:wallet_type]&.to_s || payment.source.to_s]
if selected_brand
post[:selectedBrand] = selected_brand
post[:additionalData] = {} unless post[:additionalData]
- 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_shipment_address
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add_shipment_address(post, options)
if (address = options[:shipping_address])
post[:address] = {}
post[:address][:street1] = address[:address1] if address[:address1]
post[: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"