KentaaNL/tikkie-api

View on GitHub
lib/tikkie/api/resources/payment_requests.rb

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Method load_resource has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def load_resource
params = { pageNumber: page_number, pageSize: page_size }
params[:fromDate] = options[:from_date].respond_to?(:utc) ? options[:from_date].utc.iso8601 : options[:from_date] if options.key?(:from_date)
params[:toDate] = options[:to_date].respond_to?(:utc) ? options[:to_date].utc.iso8601 : options[:to_date] if options.key?(:to_date)
 
 
Severity: Minor
Found in lib/tikkie/api/resources/payment_requests.rb - About 45 mins to fix

Similar blocks of code found in 3 locations. Consider refactoring.
Open

def payment_requests
@payment_requests ||= begin
payment_requests = []
 
if body[:paymentRequests]
Severity: Minor
Found in lib/tikkie/api/resources/payment_requests.rb and 2 other locations - About 25 mins to fix
lib/tikkie/api/resources/payment.rb on lines 46..58
lib/tikkie/api/resources/payments.rb on lines 32..44
Category
Status