inertia186/radiator

View on GitHub

Showing 1,476 of 1,476 total issues

Line is too long. [102/80]
Open

  #     steem = Radiator::Chain.new(chain: :steem, account_name: 'your account name', wif: 'your wif')
Severity: Minor
Found in lib/radiator/chain.rb by rubocop

Trailing whitespace detected.
Open

    
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

Trailing whitespace detected.
Open

    
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

Avoid the use of double negation (!!).
Open

        raise ChainError, ErrorParser.new(err) if !!err
Severity: Minor
Found in lib/radiator/chain.rb by rubocop

This cop checks for uses of double negation (!!) to convert something to a boolean value. As this is both cryptic and usually redundant, it should be avoided.

Example:

# bad
!!something

# good
!something.nil?

Please, note that when something is a boolean value !!something and !something.nil? are not the same thing. As you're unlikely to write code that can accept values of any type this is rarely a problem in practice.

Trailing whitespace detected.
Open

        
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

Indent when as deep as case.
Open

      when String
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

This cop checks how the whens of a case expression are indented in relation to its case or end keyword.

It will register a separate offense for each misaligned when.

Example:

# If Layout/EndAlignment is set to keyword style (default)
# *case* and *end* should always be aligned to same depth,
# and therefore *when* should always be aligned to both -
# regardless of configuration.

# bad for all styles
case n
  when 0
    x * 2
  else
    y / 3
end

# good for all styles
case n
when 0
  x * 2
else
  y / 3
end

Example: EnforcedStyle: case (default)

# if EndAlignment is set to other style such as
# start_of_line (as shown below), then *when* alignment
# configuration does have an effect.

# bad
a = case n
when 0
  x * 2
else
  y / 3
end

# good
a = case n
    when 0
      x * 2
    else
      y / 3
end

Example: EnforcedStyle: end

# bad
a = case n
    when 0
      x * 2
    else
      y / 3
end

# good
a = case n
when 0
  x * 2
else
  y / 3
end

Use snake_case for method names.
Open

    def pakS(i)
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Avoid using rescue in its modifier form.
Open

          Time.parse(tx[:expiration] + 'Z') rescue nil
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

This cop checks for uses of rescue in its modifier form.

Example:

# bad
some_method rescue handle_error

# good
begin
  some_method
rescue
  handle_error
end

Use snake_case for method names.
Open

    def pakStr(s)
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
def fooBar; end

# good
def foo_bar; end

Example: EnforcedStyle: camelCase

# bad
def foo_bar; end

# good
def fooBar; end

Freeze mutable objects assigned to constants.
Open

    NETWORKS_TEST_ADDRESS_PREFIX = 'TST'
Severity: Minor
Found in lib/radiator/chain_config.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Convert if nested inside else to elsif.
Open

          if !!prefix
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

If the else branch of a conditional consists solely of an if node, it can be combined with the else to become an elsif. This helps to keep the nesting level from getting too deep.

Example:

# bad
if condition_a
  action_a
else
  if condition_b
    action_b
  else
    action_c
  end
end

# good
if condition_a
  action_a
elsif condition_b
  action_b
else
  action_c
end

%w-literals should be delimited by [ and ].
Open

      if %w(DEBUG TRACE).include? ENV['LOG']
Severity: Minor
Found in lib/radiator/utils.rb by rubocop

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

Freeze mutable objects assigned to constants.
Open

    NETWORKS_HIVE_CHAIN_ID = 'beeab0de00000000000000000000000000000000000000000000000000000000'
Severity: Minor
Found in lib/radiator/chain_config.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Freeze mutable objects assigned to constants.
Open

    NETWORKS_HIVE_DEFAULT_NODE = 'https://api.openhive.network'
Severity: Minor
Found in lib/radiator/chain_config.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

FIXME found
Open

      # FIXME Should pakC(0) instead?
Severity: Minor
Found in lib/radiator/transaction.rb by fixme

TODO found
Open

        # TODO Some blockchains (like Golos) do not have transaction_ids.  In
Severity: Minor
Found in lib/radiator/api.rb by fixme
Severity
Category
Status
Source
Language