mad-raz/EGP-Rates

View on GitHub
lib/egp_rates.rb

Summary

Maintainability
A
25 mins
Test Coverage

Showing 3 of 3 total issues

Method exchange_rate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def self.exchange_rate(sym = :USD, cache_result = true)
@exchange_rates ||= exchange_rates if cache_result
@exchange_rates = exchange_rates unless cache_result
 
@exchange_rates.each_with_object({}) do |rates, result|
Severity: Minor
Found in lib/egp_rates.rb - About 25 mins to fix

Remove unnecessary require statement.
Open

require 'thread'
Severity: Minor
Found in lib/egp_rates.rb by rubocop

Use %i or %I for an array of symbols.
Open

(constants - [:Bank, :ResponseError]).each_with_object({}) do |klass, rates|
Severity: Minor
Found in lib/egp_rates.rb by rubocop
Category
Status