lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb
Class CecabankJsonGateway
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class CecabankJsonGateway < Gateway
include CecabankCommon
CECA_ACTIONS_DICTIONARY = {
purchase: :REST_AUTORIZACION,
File cecabank_json.rb
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'active_merchant/billing/gateways/cecabank/cecabank_common'
module ActiveMerchant
module Billing
class CecabankJsonGateway < Gateway
Method add_stored_credentials
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_stored_credentials(post, creditcard, options)
return unless stored_credential = options[:stored_credential]
return if options[:exemption_type].blank? && !(stored_credential[:reason_type] && stored_credential[:initiator])
- 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_invoice_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_auth_invoice_data(action, post, money, authorization, options)
Method add_three_d_secure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_three_d_secure(post, options)
params = post[:parametros] ||= {}
return unless three_d_secure = options[:three_d_secure]
params[:exencionSCA] ||= CECA_SCA_TYPES.fetch(options[:exemption_type]&.to_sym, :NONE)
- 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"