inertia186/radiator

View on GitHub
lib/radiator/ssc/blockchain.rb

Summary

Maintainability
A
0 mins
Test Coverage

Indent access modifiers like protected.
Open

    protected
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Modifiers should be indented as deep as method definitions, or as deep as the class/module keyword, depending on configuration.

Example: EnforcedStyle: indent (default)

# bad
class Plumbus
private
  def smooth; end
end

# good
class Plumbus
  private
  def smooth; end
end

Example: EnforcedStyle: outdent

# bad
class Plumbus
  private
  def smooth; end
end

# good
class Plumbus
private
  def smooth; end
end

Line is too long. [124/80]
Open

      # @option options [String] :url Specify the full node end-point.  Default: https://api.steem-engine.net/rpc/blockchain
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Redundant begin block detected.
Open

        begin
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

This cop checks for redundant begin blocks.

Currently it checks for code like this:

Example:

def redundant
  begin
    ala
    bala
  rescue StandardError => e
    something
  end
end

def preferred
  ala
  bala
rescue StandardError => e
  something
end

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

          !!shutdown
Severity: Minor
Found in lib/radiator/ssc/blockchain.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/ssc/blockchain.rb by rubocop

Keep a blank line before and after protected.
Open

    protected
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Access modifiers should be surrounded by blank lines.

Example:

# bad
class Foo
  def bar; end
  private
  def baz; end
end

# good
class Foo
  def bar; end

  private

  def baz; end
end

Avoid rescuing without specifying an error class.
Open

        rescue => e
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

This cop checks for rescuing StandardError. There are two supported styles implicit and explicit. This cop will not register an offense if any error other than StandardError is specified.

Example: EnforcedStyle: implicit

# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.

# bad
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Example: EnforcedStyle: explicit (default)

# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.

# bad
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Space inside } missing.
Open

          request(method: 'getBlockInfo', params: {blockNumber: -1}, skip_health_check: true).nil?
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Space inside { missing.
Open

        request(method: 'getBlockInfo', params: {blockNumber: block_num})
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Space inside { missing.
Open

        request(method: 'getTransactionInfo', params: {txid: trx_id})
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Space inside { missing.
Open

          request(method: 'getBlockInfo', params: {blockNumber: -1}, skip_health_check: true).nil?
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Trailing whitespace detected.
Open

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

Trailing whitespace detected.
Open

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

Trailing whitespace detected.
Open

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

Trailing whitespace detected.
Open

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

Line is too long. [98/80]
Open

          request(method: 'getBlockInfo', params: {blockNumber: -1}, skip_health_check: true).nil?
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Space inside } missing.
Open

        request(method: 'getTransactionInfo', params: {txid: trx_id})
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

Space inside } missing.
Open

        request(method: 'getBlockInfo', params: {blockNumber: block_num})
Severity: Minor
Found in lib/radiator/ssc/blockchain.rb by rubocop

Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

Example: EnforcedStyle: space

# The `space` style enforces that hash literals have
# surrounding space.

# bad
h = {a: 1, b: 2}

# good
h = { a: 1, b: 2 }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that hash literals have
# no surrounding space.

# bad
h = { a: 1, b: 2 }

# good
h = {a: 1, b: 2}

Example: EnforcedStyle: compact

# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.

# bad
h = { a: { b: 2 } }

# good
h = { a: { b: 2 }}

There are no issues that match your filters.

Category
Status