Showing 14 of 14 total issues
Method from_response
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.from_response(api_call, kb_account_id, kb_payment_id, kb_payment_transaction_id, transaction_type, payment_processor_account_id, kb_tenant_id, response, extra_params = {}, model = ::Killbill::Litle::LitleResponse)
Method capture_payment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
Method from_response
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.from_response(kb_account_id, kb_payment_method_id, kb_tenant_id, cc_or_token, response, options, extra_params = {}, model = ::Killbill::Litle::LitlePaymentMethod)
Method refund_payment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
Method purchase_payment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
Method credit_payment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
Method authorize_payment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
Method void_payment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context)
Method add_payment_method
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
Method search_payments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_payments(search_key, offset, limit, properties, context)
Method search_payment_methods
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_payment_methods(search_key, offset, limit, properties, context)
Method add_payment_method
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
# paypageRegistrationId is passed via properties
paypage_registration_id = find_value_from_properties(properties, 'paypageRegistrationId')
# paypageRegistrationId is passed from the json body
paypage_registration_id = find_value_from_properties(payment_method_props.properties, 'paypageRegistrationId') if paypage_registration_id.nil?
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse(kind, xml)
parsed = {}
doc = Nokogiri::XML(xml).remove_namespaces!
response_nodes = doc.xpath("//litleOnlineResponse/#{kind}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 each
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def each(&block)
(0..(@limit - @batch)).step(@batch) do |i|
result = @delegate.call(i, @batch)
block.call(result)
# Optimization: bail out if no more results
- 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"