Showing 7 of 16 total issues
Method post_private
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def post_private(method, params = {})
params['nonce'] = nonce
response = retryable_http_request do
http_adapter("https://api.kraken.com").post(url_path(method), params) do |request|
- 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 to_s
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def to_s(with_currency: true, auto_format: true, tooltip_currency: false)
amount = dup
currency = self.currency.dup
old_amount_string = if tooltip_currency
- 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_private
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def post_private(method, params = {})
params['method'] = method
params['nonce'] = nonce
response = retryable_http_request 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 trade!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def trade!(args, simulate: false)
params = {
pair: "XXBTZ#{fiat_currency}",
type: args.fetch(:type),
volume: args.fetch(:volume),
Method to_s
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s(with_currency: true, auto_format: true, tooltip_currency: false)
amount = dup
currency = self.currency.dup
old_amount_string = if tooltip_currency
Method best_offer_price_for_fiat_amount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def best_offer_price_for_fiat_amount(type, fiat_amount, fiat_currency)
total_fiat_amount = 0
good_offers = []
offers = public_send(type).dup # asks or bids
- 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 rate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.rate(from, to)
pair = [from, to].join
if @rates[pair].nil? || @rates[pair].updated_at < Time.now - 10 * 60
- 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"