Showing 999 of 1,496 total issues
Method parse
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def parse(body)
response = {}
root = REXML::Document.new(body).root
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def add_address(doc, address)
return unless address
doc.companyName(address[:company]) unless address[:company].blank?
doc.addressLine1(truncate(address[:address1], 35)) unless address[:address1].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_sub_merchant_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_sub_merchant_data(xml, options)
xml.subMerchantData do
xml.pfId options[:pf_id] if options[:pf_id]
xml.subName options[:sub_name] if options[:sub_name]
xml.subId options[:sub_id] if options[:sub_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_three_d_secure
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_three_d_secure(xml, options)
three_d_secure = options[:three_d_secure]
xml.tag! 'ThreeDSecureRequest' do
xml.tag! 'MpiVendor3ds', 'Y'
xml.tag! 'AuthStatus3ds', three_d_secure[:authentication_response_status] || three_d_secure[:trans_status] if three_d_secure[:authentication_response_status] || three_d_secure[:trans_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_rooms
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_rooms(lodging_options)
rooms = []
lodging_options[:rooms]&.each do |item|
room = {}
room['dailyRoomRate'] = item[:daily_room_rate] if item[:daily_room_rate]
- 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_product_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_product_data(post, money, options)
post[:account_id] = @options[:account_id]
post[:amount] = amount(money)
post[:short_description] = (options[:description] || 'Purchase')
post[:type] = (options[:type] || 'goods')
- 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 store
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def store(creditcard, options = {})
post = {}
post[:client_id] = @options[:client_id]
post[:user_name] = "#{creditcard.first_name} #{creditcard.last_name}"
post[:email] = options[:email] || 'unspecified@example.com'
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def add_credit_card(xml, payment, options = {}, credit_envelope = 'v1')
if payment&.is_a?(CreditCard)
requires!(options.merge!({ card_number: payment.number, month: payment.month, year: payment.year }), :card_number, :month, :year)
xml.tag!("#{credit_envelope}:CreditCardData") 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 create_post_for_auth_or_purchase
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def create_post_for_auth_or_purchase(token, money, options)
{
'token' => token,
'orderDescription' => options[:description] || 'Worldpay Order',
'amount' => money,
- 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_details
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_customer_details(post, payment, options)
if address = options[:billing_address] || options[:address]
post[:sg_FirstName] = payment.first_name if payment.respond_to?(:first_name)
post[:sg_LastName] = payment.last_name if payment.respond_to?(:last_name)
post[:sg_Address] = 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
Class WorldpayUsGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class WorldpayUsGateway < Gateway
class_attribute :backup_url
self.display_name = 'Worldpay US'
self.homepage_url = 'http://www.worldpay.com/us'
Class DataCashGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class DataCashGateway < Gateway
self.default_currency = 'GBP'
self.supported_countries = ['GB']
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
Class BamboraApacGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class BamboraApacGateway < Gateway
self.live_url = 'https://www.bambora.co.nz/interface/api'
self.test_url = 'https://demo.bambora.co.nz/interface/api'
self.supported_countries = %w[AU NZ]
Class ProPayGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ProPayGateway < Gateway
self.test_url = 'https://xmltest.propay.com/API/PropayAPI.aspx'
self.live_url = 'https://epay.propay.com/api/propayapi.aspx'
self.supported_countries = %w[US CA]
Class ConektaGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ConektaGateway < Gateway
self.live_url = 'https://api.conekta.io/'
self.supported_countries = ['MX']
self.supported_cardtypes = %i[visa master american_express carnet]
Class AlliedWalletGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class AlliedWalletGateway < Gateway
self.display_name = 'Allied Wallet'
self.homepage_url = 'https://www.alliedwallet.com'
self.live_url = 'https://api.alliedwallet.com/merchants/'
Class ClearhausGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ClearhausGateway < Gateway
self.test_url = 'https://gateway.test.clearhaus.com'
self.live_url = 'https://gateway.clearhaus.com'
self.supported_countries = %w[DK NO SE FI DE CH NL AD AT BE BG HR CY CZ FO GL EE FR GR
Class Flo2cashGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Flo2cashGateway < Gateway
self.display_name = 'Flo2Cash'
self.homepage_url = 'http://www.flo2cash.co.nz/'
self.test_url = 'https://demo.flo2cash.co.nz/ws/paymentws.asmx'
Class FirstPayJsonGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class FirstPayJsonGateway < Gateway
include FirstPayCommon
ACTIONS = {
purchase: 'Sale',
Class EfsnetGateway
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class EfsnetGateway < Gateway
self.supported_countries = ['US']
self.supported_cardtypes = %i[visa master american_express discover]
self.homepage_url = 'http://www.concordefsnet.com/'
self.display_name = 'Efsnet'