Showing 999 of 1,496 total issues
Method commit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def commit(action, money, options)
request = build_request(action, money, options)
headers = { 'Content-Type' => 'text/xml',
'Authorization' => encoded_credentials }
- 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 create_customer_profile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_customer_profile(options)
requires!(options, :profile)
requires!(options[:profile], :email) unless options[:profile][:merchant_customer_id] || options[:profile][:description]
requires!(options[:profile], :description) unless options[:profile][:email] || options[:profile][:merchant_customer_id]
requires!(options[:profile], :merchant_customer_id) unless options[:profile][:description] || options[:profile][:email]
- 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_card_on_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_card_on_file(post, options)
return unless options[:stored_credential] || options[:usage_indicator] || options[:indicator] || options[:scheduled_indicator] || options[:transaction_id]
stored_credential = options[:stored_credential] || {}
post[:cardOnFile] = {}
- 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_eci
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_eci(payment)
return nil unless payment.is_a?(NetworkTokenizationCreditCard)
if (eci = payment.eci)
eci = eci[0] == '0' ? eci.sub!(/^0/, '') : eci
- 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_credential_params
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credential_params(doc, options = {})
return unless stored_credential = options[:stored_credential]
if stored_credential[:initial_transaction]
add_stored_credential_for_initial_txn(doc, 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 build_non_authorized_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_non_authorized_request(action, money, credit_card, options)
xml = Builder::XmlMarkup.new
xml.tag! 'TStream' do
xml.tag! 'Transaction' 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_address
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_address(post, card, options)
return unless address = options[:billing_address] || options[:address]
address_object = {}
address_object[:state] = address[:state] if address[:state]
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credentials(params, options)
if options[:sequence] || options[:stored_credential]
params[:stored_credentials] = {}
params[:stored_credentials][:cardbrand_original_transaction_id] = original_transaction_id(options) if original_transaction_id(options)
params[:stored_credentials][:initiator] = initiator(options) if initiator(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_descriptor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_descriptor(doc, options)
if options[:descriptor_name] || options[:descriptor_phone]
doc.customBilling do
doc.phone(options[:descriptor_phone]) if options[:descriptor_phone]
doc.descriptor(options[:descriptor_name]) if options[:descriptor_name]
- 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_creditcard
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_creditcard(post, creditcard, options = {})
if creditcard.respond_to?(:number)
post[:card_number] = creditcard.number
post[:card_expiry] = "#{creditcard.month}/#{creditcard.year}"
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
- 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 commit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def commit(url, parameters = nil, options = {}, method = nil)
if parameters.present? && parameters[:threeDSecure].present?
three_ds_errors = validate_three_ds_params(parameters[:threeDSecure][:external])
return three_ds_errors if three_ds_errors
end
- 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_level_two_and_three_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_level_two_and_three_data(xml, amount, data)
xml.invoiceReferenceNumber data[:invoice_reference_number] if data.include?(:invoice_reference_number)
xml.customerReference data[:customer_reference] if data.include?(:customer_reference)
xml.cardAcceptorTaxId data[:card_acceptor_tax_id] if data.include?(:card_acceptor_tax_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 commit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def commit(post, options)
url = (test? ? test_url : live_url)
action = determine_action(options)
raw_response = parse(ssl_post(url + action, post_data(post, options)))
payload = raw_response['Ds_MerchantParameters']
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def add_billing_address(post, options, address)
address[:address1] = 'NA' if address[:address1].blank?
address[:address2] = 'NA' if address[:address2].blank?
post[:billingAddress] = {}
- 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_processing_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_processing_options(xml, options)
return unless options[:stored_credential]
xml.processingOptions do
if options[:stored_credential][:initial_transaction] && options[:stored_credential][:reason_type] == 'recurring'
- 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_three_d_secure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_three_d_secure(xml, card_or_token, options)
return unless (three_d_secure = options[:three_d_secure])
xml.hps :Secure3D do
xml.hps :Version, three_d_secure[:version]
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def add_address(post, creditcard, options)
if address = options[:billing_address] || options[:address]
post[:address1] = address[:address1].to_s
post[:address2] = address[:address2].to_s unless address[:address2].blank?
post[:company] = address[:company].to_s
- 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_recurring_processing_model
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_recurring_processing_model(post, options)
return unless options.dig(:stored_credential, :reason_type) || options[:recurring_processing_model]
if options.dig(:stored_credential, :reason_type) == 'unscheduled'
if options.dig(:stored_credential, :initiator) == 'merchant'
- 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_surcharge_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_surcharge_fields(xml, options)
surcharge = options[:surcharge] if options[:surcharge]
if surcharge.is_a?(Hash)
xml.surcharge do
xml.amount(amount(surcharge[:amount].to_i)) if surcharge[:amount]
- 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 capture
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def capture(money, authorization, options = {})
authorization = order_id_from_authorization(authorization.to_s)
MultiResponse.run do |r|
r.process { inquire_request(authorization, options, 'AUTHORISED', 'CAPTURED') } unless options[:authorization_validated]
if r.params
- 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"