inertia186/radiator

View on GitHub

Showing 1,476 of 1,476 total issues

Class has too many lines. [658/100]
Open

  class Api
    include Utils
    
    DEFAULT_STEEM_URL = 'https://api.steemit.com'
    
Severity: Minor
Found in lib/radiator/api.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [306/100]
Open

  class Stream < Api
    
    # @private
    INITIAL_TIMEOUT = 0.0200
    
Severity: Minor
Found in lib/radiator/stream.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for method_missing is too high. [160.8/15]
Open

    def method_missing(m, *args, &block)
      super unless respond_to_missing?(m)
      
      current_rpc_id = rpc_id
      method_name = [api_name, m].join('.')
Severity: Minor
Found in lib/radiator/api.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [149/10]
Open

    def method_missing(m, *args, &block)
      super unless respond_to_missing?(m)
      
      current_rpc_id = rpc_id
      method_name = [api_name, m].join('.')
Severity: Minor
Found in lib/radiator/api.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [262/100]
Open

  class Transaction
    include ChainConfig
    include Utils

    VALID_OPTIONS = %w(
Severity: Minor
Found in lib/radiator/transaction.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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
Severity: Minor
Found in lib/radiator/stream.rb - About 1 day to fix

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 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('.')
Severity: Minor
Found in lib/radiator/api.rb - About 1 day to fix

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 has too many lines. [178/100]
Open

  class ErrorParser
    include Utils
    
    attr_reader :response, :error, :error_code, :error_message,
      :api_name, :api_method, :api_params,
Severity: Minor
Found in lib/radiator/error_parser.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [168/100]
Open

  class Chain
    include Mixins::ActsAsPoster
    include Mixins::ActsAsVoter
    include Mixins::ActsAsWallet
    
Severity: Minor
Found in lib/radiator/chain.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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'
Severity: Major
Found in lib/radiator/api.rb - About 1 day to fix

    Method has too many lines. [98/10]
    Open

        def parse_error_response
          if response.nil?
            @expiry = false
            @can_retry = false
            @can_reprepare = false
    Severity: Minor
    Found in lib/radiator/error_parser.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Method has too many lines. [94/10]
    Open

        def blocks(start = nil, mode = :irreversible, max_blocks_per_node = MAX_BLOCKS_PER_NODE, &block)
          reset_api
          
          replay = !!start
          counter = 0
    Severity: Minor
    Found in lib/radiator/stream.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Module has too many lines. [146/100]
    Open

      module OperationTypes
        TYPES = {
          transfer: {
            amount: Hive::Type::Amount
          },
    Severity: Minor
    Found in lib/radiator/operation_types.rb by rubocop

    This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Assignment Branch Condition size for parse_error_response is too high. [91.95/15]
    Open

        def parse_error_response
          if response.nil?
            @expiry = false
            @can_retry = false
            @can_reprepare = false
    Severity: Minor
    Found in lib/radiator/error_parser.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Module has too many lines. [137/100]
    Open

      module Utils
        def extract_signatures(options)
          return [] unless defined? options[:params].map
          
          params = options[:params]
    Severity: Minor
    Found in lib/radiator/utils.rb by rubocop

    This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Assignment Branch Condition size for blocks is too high. [87.25/15]
    Open

        def blocks(start = nil, mode = :irreversible, max_blocks_per_node = MAX_BLOCKS_PER_NODE, &block)
          reset_api
          
          replay = !!start
          counter = 0
    Severity: Minor
    Found in lib/radiator/stream.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Class has too many lines. [113/100]
    Open

        class BaseSteemSmartContractRPC
          # @private
          POST_HEADERS = {
            'Content-Type' => 'application/json',
            'User-Agent' => Radiator::AGENT_ID

    This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Method has too many lines. [68/10]
    Open

        def initialize(options = {})
          @user = options[:user]
          @password = options[:password]
          @chain = (options[:chain] || 'hive').to_sym
          @url = options[:url] || Api::default_url(@chain)
    Severity: Minor
    Found in lib/radiator/api.rb by rubocop

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Block has too many lines. [121/25]
    Open

          loop do
            tries += 1
            
            if tries > 5 && flappy? && !check_file_open?
              raise ApiError, 'PANIC: Out of file resources'
    Severity: Minor
    Found in lib/radiator/api.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Assignment Branch Condition size for initialize is too high. [63.8/15]
    Open

        def initialize(options = {})
          @user = options[:user]
          @password = options[:password]
          @chain = (options[:chain] || 'hive').to_sym
          @url = options[:url] || Api::default_url(@chain)
    Severity: Minor
    Found in lib/radiator/api.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Severity
    Category
    Status
    Source
    Language