Showing 999 of 1,496 total issues
Method commit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def commit(action, params: '', iid: '', card_number: nil, jwt: '')
response =
begin
case action
when 'void'
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_payment(post, payment, options)
post[:customer][:name] = payment.name if post[:customer]
post[:customer_id] = parse_auth(payment)[0] if payment.is_a?(String)
post[:payment] = {}
affiliation = options[:gateway_affiliation_id] || @options[:gateway_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_contact_details
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_contact_details(post, contact_details_options)
contact_details = {}
contact_details[:documentType] = contact_details_options[:document_type] if contact_details_options[:document_type]
contact_details[:documentNumber] = contact_details_options[:document_number] if contact_details_options[:document_number]
contact_details[:email] = contact_details_options[:email] if contact_details_options[: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_credit_card
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_credit_card(params, credit_card, action, options)
return unless credit_card&.is_a?(CreditCard)
card_details = {}
card_details['expiryMonth'] = format(credit_card.month, :two_digits).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 commit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def commit(action, post)
add_auth(post)
post['order.type'] = TRANSACTIONS[action]
request = post.map { |k, v| "#{k}=#{CGI.escape(v.to_s)}" }.join('&')
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def commit(action, params)
raw_response = ssl_post(url, post_data(params), headers)
response = parse(raw_response)
rescue ResponseError => e
raw_response = e.response.body
- 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_soap_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_soap_request(action, body)
xml = Builder::XmlMarkup.new(indent: 2)
xml.tag!('soapenv:Envelope', envelope_namespaces) do
xml.tag!('soapenv:Header')
xml.tag!('soapenv:Body') 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 success_from
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def success_from(entity_name, raw_response)
entity = (raw_response[entity_name] || []).first
if !entity
false
elsif (entity_name == 'refunds') && entity.include?('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 message_from
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def message_from(response)
if response[:faultcode] && response[:faultstring]
response[:faultstring]
elsif response[:error_number] && response[:error_number] != '0'
response[:error_description]
- 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_customer_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_customer_data(post, options)
post[:meta] ||= {}
add_shipping(post, options) if options.key?(:shipping_address)
post[:meta][:client_customer_id] = options[:customer] if options[: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 build_create_subscription_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_create_subscription_request(payment_method, options)
default_subscription_params = { frequency: 'on-demand', amount: 0, automatic_renew: false }
options[:subscription] = default_subscription_params.update(
options[:subscription] || {}
)
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def add_stored_credentials(xml, parameters)
return unless parameters[:mit_stored_credential_ind] == 'Y' || parameters[:stored_credential] && !parameters[:stored_credential].values.all?(&:nil?)
if msg_type = get_msg_type(parameters)
xml.tag! :MITMsgType, msg_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 process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process(ignore_result = false)
return unless success?
response = yield
self << response
- 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 get_msg_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_msg_type(parameters)
return parameters[:mit_msg_type] if parameters[:mit_msg_type]
return 'CSTO' if parameters[:stored_credential][:initial_transaction]
return unless parameters[:stored_credential][:initiator] && parameters[: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 commit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def commit(request, action, amount, options)
begin
raw_response = ssl_post(test? ? self.test_url : self.live_url, build_request(request, options))
rescue ResponseError => e
raw_response = e.response.body
- 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 names_from_address
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def names_from_address(address, payment_method)
split_names(address[:name]).tap do |names|
names[0] = payment_method&.first_name unless names[0].present? || payment_method.is_a?(String)
names[1] = payment_method&.last_name unless names[1].present? || payment_method.is_a?(String)
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_ews_details
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_ews_details(xml, payment_source, parameters = {})
split_name = payment_source.first_name.split if payment_source.first_name
xml.tag! :EWSFirstName, split_name[0]
xml.tag! :EWSMiddleName, split_name[1..-1].join(' ')
xml.tag! :EWSLastName, payment_source.last_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 do_authorize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_authorize(params)
headers = {}
headers['Referer'] = (options[:password] || 'activemerchant.org')
response = raw_ssl_request(:post, live_url + 'auth/default.aspx', authorize_post_data(params), headers)
- 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_void_request_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_void_request_xml(authorization, parameters = {})
tx_ref_num, order_id = split_authorization(authorization)
xml = xml_envelope
xml.tag! :Request do
xml.tag! :Reversal 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_payment_network_token
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_payment_network_token(xml, payment_method, options)
return unless network_tokenization?(payment_method)
transaction_type = payment_method.source == :network_token ? '3' : '1'
xml.tag! 'paymentNetworkToken' 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"