Showing 35 of 50 total issues
Class Notification
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def unescape(val) #:nodoc:
if val
CGI::unescape val
Class Notification
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
self.production_ips = [
'78.108.178.206',
'79.137.235.129',
'95.163.96.79',
Class Notification
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def complete?
status == 'Completed'
end
Class Notification
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def initialize(post, options = {})
super(post, options)
@merchant_id = options[:credential1]
@secret_key = options[:credential2]
Class Notification
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
include Common
def initialize(post, options={})
super
@secret = options[:credential3]
Class Notification
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
include ActiveUtils::PostsData
include ActiveUtils::RequiresParameters
def initialize(query_string, options={})
File sage_pay_form.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OffsitePayments #:nodoc:
module Integrations #:nodoc:
module SagePayForm
mattr_accessor :production_url
mattr_accessor :test_url
Class Notification
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def complete?
status == 'Completed'
end
Class Notification
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
class CryptError < StandardError; end
include Encryption
Class Notification
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def initialize(post, options = {})
super(post, options)
@secret_key = options[:credential2]
end
Method generate_md5string
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def generate_md5string
fields = [@fields["pmt_action"], @fields["pmt_version"]]
fields += [@fields["pmt_selleriban"]] unless @fields["pmt_selleriban"].nil?
fields += [@fields["pmt_id"], @fields["pmt_orderid"], @fields["pmt_reference"], @fields["pmt_duedate"],
@fields["pmt_amount"], @fields["pmt_currency"], @fields["pmt_okreturn"], @fields["pmt_errorreturn"], @fields["pmt_cancelreturn"],
- 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
File authorize_net_sim.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OffsitePayments #:nodoc:
module Integrations #:nodoc:
module AuthorizeNetSim
# Overwrite this if you want to change the ANS test url
mattr_accessor :test_url
Class Notification
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def initialize(*args)
super
@signature = params.delete('pg_sig')
end
Method verify_response
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def verify_response(params, secret)
logstr = ''
params.each { |key, value|
logstr += "#{key} #{value}\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
File wirecard_checkout_page.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OffsitePayments #:nodoc:
module Integrations #:nodoc:
# Shop System Plugins - Terms of use
#
# This terms of use regulates warranty and liability between Wirecard Central Eastern Europe (subsequently referred to as WDCEE) and it's
File direc_pay.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OffsitePayments #:nodoc:
module Integrations #:nodoc:
module DirecPay
mattr_accessor :production_url, :test_url
Class Notification
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Notification < OffsitePayments::Notification
def generate_signature_string
"#{uid}:#{gross}:#{gross_shop}:#{gross_client}:#{currency}:#{order_id}:#{payment_method_id}:#{payment_method_title}:#{client_email}:#{secret}"
end
Method form_fields
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def form_fields
map_billing_address_to_shipping_address unless @shipping_address_set
fields['DeliveryFirstnames'] ||= fields['BillingFirstnames']
fields['DeliverySurname'] ||= fields['BillingSurname']
- 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 shipping_address
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def shipping_address(params = {})
# Get the country code in the correct format
# Use what we were given if we can't find anything
country_code = lookup_country_code(params.delete(:country))
add_field(mappings[:shipping_address][:country], country_code)
- 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 verify_response
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify_response(params, secret)
logstr = ''
params.each { |key, value|
logstr += "#{key} #{value}\n"
}