Showing 67 of 1,476 total issues
Method method_missing
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(m, *args, &block)
super unless respond_to_missing?(m)
current_rpc_id = rpc_id
method_name = [api_name, m].join('.')
- 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 blocks
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def blocks(start = nil, mode = :irreversible, max_blocks_per_node = MAX_BLOCKS_PER_NODE, &block)
reset_api
replay = !!start
counter = 0
- 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
File api.rb
has 669 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'uri'
require 'base64'
require 'hashie'
require 'hashie/logger'
require 'openssl'
Method method_missing
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
def method_missing(m, *args, &block)
super unless respond_to_missing?(m)
current_rpc_id = rpc_id
method_name = [api_name, m].join('.')
Method method_missing
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(m, *args, &block)
super unless respond_to_missing?(m)
@latest_values ||= []
@latest_values.shift(5) if @latest_values.size > 20
- 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 operations
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def operations(type = nil, start = nil, mode = :irreversible, options = {include_virtual: false}, &block)
type = [type].flatten.compact.map(&:to_sym)
include_virtual = !!options[:include_virtual]
if virtual_op_type?(type)
- 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 prepare
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def prepare
raise TransactionError, "No wif or private key." unless !!@wif || !!@private_key
@payload = 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
Class Api
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Api
include Utils
DEFAULT_STEEM_URL = 'https://api.steemit.com'
Method parse_error_response
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def parse_error_response
if response.nil?
@expiry = false
@can_retry = false
@can_reprepare = false
- 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 finalize
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def self.finalize(api, network_broadcast_api, self_logger, logger)
proc {
if !!api && !api.stopped?
puts "DESTROY: #{api.inspect}" if ENV['LOG'] == 'TRACE'
api.shutdown
- 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_error_response
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_error_response
if response.nil?
@expiry = false
@can_retry = false
@can_reprepare = false
Method shutdown
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def shutdown
@uri = nil
@http_id = nil
@http_memo.each do |k|
v = @http_memo.delete(k)
- 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 blocks
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
def blocks(start = nil, mode = :irreversible, max_blocks_per_node = MAX_BLOCKS_PER_NODE, &block)
reset_api
replay = !!start
counter = 0
Method handle_error
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def handle_error(response, request_options, method_name, tries)
parser = ErrorParser.new(response)
_signatures, exp = extract_signatures(request_options)
if (!!exp && exp < Time.now.utc) || (tries > 2 && !parser.node_degraded?)
- 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
File stream.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Radiator
# Radiator::Stream allows a live view of the STEEM blockchain.
#
# All values returned by `get_dynamic_global_properties` can be streamed.
#
Method default_failover_urls
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.default_failover_urls(chain)
case chain.to_sym
when :steem, :hive
begin
_api = Radiator::Api.new(url: DEFAULT_HIVE_FAILOVER_URLS.sample, failover_urls: DEFAULT_HIVE_FAILOVER_URLS)
- 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 initialize
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(options = {})
@user = options[:user]
@password = options[:password]
@chain = (options[:chain] || 'hive').to_sym
@url = options[:url] || Api::default_url(@chain)
File transaction.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bitcoin'
require 'digest'
require 'time'
module Radiator
Class Chain
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Chain
include Mixins::ActsAsPoster
include Mixins::ActsAsVoter
include Mixins::ActsAsWallet
Method process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def process(broadcast = false)
prepare
if broadcast
loop 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"