Showing 8 of 8 total issues
Class Gateway
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Gateway
extend Forwardable
def_delegators :config, :logger
Method parse
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(brq_transaction_type, brq_recurring)
if brq_transaction_type && !brq_transaction_type.empty?
case brq_transaction_type
when 'C021', 'V021', # iDEAL
'C002', 'C004', 'C005', # (SEPA) Direct Debit
Method build_transaction_request_params
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_transaction_request_params(options)
params = {}
case options[:payment_method]
when PaymentMethod::IDEAL
- 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_transaction_request_params
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_transaction_request_params(options)
params = {}
case options[:payment_method]
when PaymentMethod::IDEAL
Method map_fields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def map_fields(params, prefix)
results = []
index = 1
loop 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 map_fields
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def map_fields(params, prefix)
results = []
index = 1
loop do
Method parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(brq_transaction_type, brq_recurring)
if brq_transaction_type && !brq_transaction_type.empty?
case brq_transaction_type
when 'C021', 'V021', # iDEAL
'C002', 'C004', 'C005', # (SEPA) Direct Debit
- 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 post_buckaroo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def post_buckaroo(uri, params)
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == 'https'
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
- 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"