Showing 1,005 of 1,501 total issues
Method add_stored_credentials
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credentials(xml, options)
return unless options[:stored_credential]
xml.hps :CardOnFileData do
if options[:stored_credential][:initiator] == 'customer'
- 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_elements
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_elements(node, response)
node_name = node.name.underscore
node.attributes.each do |k, v|
response["#{node_name}_#{k.underscore}".to_sym] = v.value
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_3d_secure_1_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_3d_secure_1_data(post, options)
if three_d_secure_options = options[:three_d_secure]
post[:i8] = build_i8(
three_d_secure_options[:eci],
three_d_secure_options[:cavv],
- 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 url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def url(action, url_override = nil)
if url_override.to_s == 'payment_redirect' && action == 'payments'
(self.test? ? self.payment_redirect_test : self.payment_redirect_live) + action.to_s
else
(self.test? ? self.test_url : self.live_url) + action.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_stored_credential_used
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credential_used(post, options)
post[:payment_information] ||= '2'
post[:issuer_id] = options[:stored_credential][:network_transaction_id] if options[:issuer_id].blank?
if options[:stored_credential][:initiator] == 'merchant'
case options[:stored_credential][:reason_type]
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def add_address(doc, options)
address = options[:billing_address]
return unless address
doc.country(address[:country]) if address[:country]
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(response)
params = {}
lines = response.split("\n")
- 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_initial
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credential_initial(post, options)
post[:payment_information] ||= '0'
post[:issuer_id] ||= ''
if options[:stored_credential][:initiator] == 'merchant'
case options[:stored_credential][:reason_type]
- 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_credit_card_eci
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_credit_card_eci(xml, credit_card, options)
eci = if credit_card.is_a?(NetworkTokenizationCreditCard) && credit_card.source == :apple_pay && card_brand(credit_card) == 'discover'
# Payeezy requires an ECI of 5 for apple pay transactions
# See: https://support.payeezy.com/hc/en-us/articles/203730589-Ecommerce-Flag-Values
'05'
- 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 purchase
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def purchase(money, payment, options = {})
if ach?(payment)
direct_bank_error = 'Direct bank account transactions are not supported. Bank accounts must be stored and verified before use.'
return Response.new(false, direct_bank_error)
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 transaction_hash
has a Cognitive Complexity of 9 (exceeds 5 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),
- 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_xml_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_xml_request(transaction_type, options = {}, transaction_id = nil, &block)
xml = Builder::XmlMarkup.new
xml.tag! 'JetPay' do
# The basic values needed for any request
xml.tag! 'TerminalID', @options[:login]
- 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_auth_purchase_params
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_auth_purchase_params(post, money, credit_card, options)
post[:payment_method_id] = add_payment_method_id(credit_card, options)
post[:site_transaction_id] = options[:order_id]
post[:bin] = credit_card.number[0..5]
post[:payment_type] = options[:payment_type] || 'single'
- 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 authorize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def authorize(money, payment, options = {})
if ach?(payment)
direct_bank_error = 'Direct bank account transactions are not supported for authorize.'
return Response.new(false, direct_bank_error)
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_payment_method
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_payment_method(parameters, credit_card_or_vault_id, options)
if credit_card_or_vault_id.is_a?(String) || credit_card_or_vault_id.is_a?(Integer)
add_third_party_token(parameters, credit_card_or_vault_id, options)
else
parameters[:customer].merge!(
- 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_element
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_element(reply, node)
if node.has_elements?
node.elements.each { |e| parse_element(reply, e) }
else
if /item/.match?(node.parent.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_address
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_address(post, creditcard, options)
if address = options[:billing_address]
post[:street] = address[:address1].to_s
post[:city] = address[:city].to_s
post[:state] = (address[:state].blank? ? 'NA' : address[:state].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_credit_card_eci
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_credit_card_eci(xml, credit_card, options)
eci =
if credit_card.is_a?(NetworkTokenizationCreditCard) && credit_card.source == :apple_pay && card_brand(credit_card) == 'discover'
# Discover requires any Apple Pay transaction, regardless of in-app
# or web, and regardless of the ECI contained in the PKPaymentToken,
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credential(post, options)
return unless options[:stored_credential]
post[:storedCredential] = {}
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def add_three_d_secure(post, payment_method, options)
three_d_secure = options[:three_d_secure]
return unless three_d_secure.present?
post[:threeDomainSecure] = {
- 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"