inertia186/radiator

View on GitHub
Rakefile

Summary

Maintainability
Test Coverage

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

task :test_live_stream, [:chain, :persist] do |t, args|
  chain = (args[:chain] || 'hive').to_sym
  persist = (args[:persist] || 'true') == 'true'
  last_block_number = 0
  # url = 'https://testnet.steemitdev.com/'
Severity: Minor
Found in Rakefile 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.

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

task :test_live_broadcast, [:account, :wif, :chain] do |t, args|
  account_name = args[:account] || 'social'
  posting_wif = args[:wif] || '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
  chain = (args[:chain] || 'hive').to_sym
  # url = 'https://testnet.steemitdev.com/' # use testnet
Severity: Minor
Found in Rakefile 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.

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

  Radiator::Stream.new(options).blocks do |b, n, api|
    start = Time.now.utc
    
    if last_block_number == 0
      # skip test
Severity: Minor
Found in Rakefile 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.

Indent when as deep as case.
Open

  when :hive then ['0.000 HIVE', '0.000 HBD', '0.000001 VESTS']
Severity: Minor
Found in Rakefile 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

Trailing whitespace detected.
Open

  
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

      
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

        
Severity: Minor
Found in Rakefile by rubocop

Unused block argument - t. You can omit the argument if you don't care about it.
Open

  task :vcr do |t|
Severity: Minor
Found in Rakefile by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

Use last_block_number.zero? instead of last_block_number == 0.
Open

    if last_block_number == 0
Severity: Minor
Found in Rakefile by rubocop

This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

Example: EnforcedStyle: predicate (default)

# bad

foo == 0
0 > foo
bar.baz > 0

# good

foo.zero?
foo.negative?
bar.baz.positive?

Example: EnforcedStyle: comparison

# bad

foo.zero?
foo.negative?
bar.baz.positive?

# good

foo == 0
0 > foo
bar.baz > 0

Trailing whitespace detected.
Open

      
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

  
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

    
Severity: Minor
Found in Rakefile by rubocop

Indent when as deep as case.
Open

  when :steem then ['0.000 STEEM', '0.000 SBD', '0.000001 VESTS']
Severity: Minor
Found in Rakefile 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

Trailing whitespace detected.
Open

    
Severity: Minor
Found in Rakefile by rubocop

Space inside { missing.
Open

  options = {chain: chain, persist: persist, url: url, use_condenser_namespace: false}
Severity: Minor
Found in Rakefile 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 }}

end at 15, 2 is not aligned with if at 11, 17.
Open

  end
Severity: Minor
Found in Rakefile by rubocop

This cop checks whether the end keywords are aligned properly.

Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

Example: EnforcedStyleAlignWith: keyword (default)

# bad

variable = if true
    end

# good

variable = if true
           end

Example: EnforcedStyleAlignWith: variable

# bad

variable = if true
    end

# good

variable = if true
end

Example: EnforcedStyleAlignWith: startofline

# bad

variable = if true
    end

# good

puts(if true
end)

end at 133, 8 is not aligned with if at 129, 20.
Open

        end
Severity: Minor
Found in Rakefile by rubocop

This cop checks whether the end keywords are aligned properly.

Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

Example: EnforcedStyleAlignWith: keyword (default)

# bad

variable = if true
    end

# good

variable = if true
           end

Example: EnforcedStyleAlignWith: variable

# bad

variable = if true
    end

# good

variable = if true
end

Example: EnforcedStyleAlignWith: startofline

# bad

variable = if true
    end

# good

puts(if true
end)

Line is too long. [86/80]
Open

  options = {chain: chain, persist: persist, url: url, use_condenser_namespace: false}
Severity: Minor
Found in Rakefile by rubocop

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

      puts "https://hiveblocks.com/b/#{result[:block_num]}" if !!result[:block_num]
Severity: Minor
Found in Rakefile 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.

Use 2 (not -13) spaces for indentation.
Open

    '-W2'
  else
    '-W1'
Severity: Minor
Found in Rakefile by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

end at 44, 2 is not aligned with case at 41, 42.
Open

  end
Severity: Minor
Found in Rakefile by rubocop

This cop checks whether the end keywords are aligned properly.

Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

Example: EnforcedStyleAlignWith: keyword (default)

# bad

variable = if true
    end

# good

variable = if true
           end

Example: EnforcedStyleAlignWith: variable

# bad

variable = if true
    end

# good

variable = if true
end

Example: EnforcedStyleAlignWith: startofline

# bad

variable = if true
    end

# good

puts(if true
end)

Trailing whitespace detected.
Open

      
Severity: Minor
Found in Rakefile by rubocop

Line is too long. [113/80]
Open

desc 'Tests the ability to broadcast live data.  This task broadcasts a claim_reward_balance of 0.0000001 VESTS.'
Severity: Minor
Found in Rakefile by rubocop

Line is too long. [83/80]
Open

  posting_wif = args[:wif] || '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

  
Severity: Minor
Found in Rakefile by rubocop

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

      puts "https://steemd.com/tx/#{result[:id]}" if !!result[:id]
Severity: Minor
Found in Rakefile 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.

Use 2 (not -10) spaces for indentation.
Open

          total_vops / total_ops
Severity: Minor
Found in Rakefile by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Trailing whitespace detected.
Open

  
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

  
Severity: Minor
Found in Rakefile by rubocop

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

      puts "https://hiveblocks.com/tx/#{result[:id]}" if !!result[:id]
Severity: Minor
Found in Rakefile 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.

Favor format over String#%.
Open

        puts "#{n}: #{b.witness}; trx: #{t_size}; op: #{op_size}, vop: #{vop_size} (cumulative vop ratio: #{('%.2f' % (vop_ratio * 100))} %; average #{((elapsed / count) * 1000).to_i}ms)"
Severity: Minor
Found in Rakefile by rubocop

This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.

The detection of String#% cannot be implemented in a reliable manner for all cases, so only two scenarios are considered - if the first argument is a string literal and if the second argument is an array literal.

Example: EnforcedStyle: format(default)

# bad
puts sprintf('%10s', 'hoge')
puts '%10s' % 'hoge'

# good
puts format('%10s', 'hoge')

Example: EnforcedStyle: sprintf

# bad
puts format('%10s', 'hoge')
puts '%10s' % 'hoge'

# good
puts sprintf('%10s', 'hoge')

Example: EnforcedStyle: percent

# bad
puts format('%10s', 'hoge')
puts sprintf('%10s', 'hoge')

# good
puts '%10s' % 'hoge'

Trailing whitespace detected.
Open

    
Severity: Minor
Found in Rakefile by rubocop

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

      puts "https://steemd.com/b/#{result[:block_num]}" if !!result[:block_num]
Severity: Minor
Found in Rakefile 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.

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

  exec "irb -r radiator -I ./lib"
Severity: Minor
Found in Rakefile by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Align else with if.
Open

        else
Severity: Minor
Found in Rakefile by rubocop

This cops checks the alignment of else keywords. Normally they should be aligned with an if/unless/while/until/begin/def keyword, but there are special cases when they should follow the same rules as the alignment of end.

Example:

# bad
if something
  code
 else
  code
end

# bad
if something
  code
 elsif something
  code
end

# good
if something
  code
else
  code
end

Block body expression is on the same line as the block start.
Open

      catch :try_vops do; api.get_ops_in_block(n, true) do |vops, error|
        if !!error
          puts "Error on get_ops_in_block for block #{n}"
          ap error if defined? ap
        end
Severity: Minor
Found in Rakefile by rubocop

This cop checks whether the multiline do end blocks have a newline after the start of the block. Additionally, it checks whether the block arguments, if any, are on the same line as the start of the block.

Example:

# bad
blah do |i| foo(i)
  bar(i)
end

# bad
blah do
  |i| foo(i)
  bar(i)
end

# good
blah do |i|
  foo(i)
  bar(i)
end

# bad
blah { |i| foo(i)
  bar(i)
}

# good
blah { |i|
  foo(i)
  bar(i)
}

Space inside { missing.
Open

  options = {chain: chain, wif: posting_wif, url: url}
Severity: Minor
Found in Rakefile 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 Rakefile by rubocop

Unused block argument - t. If it's necessary, use _ or _t as an argument name to indicate that it won't be used.
Open

task :test_live_broadcast, [:account, :wif, :chain] do |t, args|
Severity: Minor
Found in Rakefile by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

Line is too long. [83/80]
Open

      puts "https://hiveblocks.com/b/#{result[:block_num]}" if !!result[:block_num]
Severity: Minor
Found in Rakefile by rubocop

Trailing whitespace detected.
Open

        
Severity: Minor
Found in Rakefile by rubocop

Line is too long. [187/80]
Open

        puts "#{n}: #{b.witness}; trx: #{t_size}; op: #{op_size}, vop: #{vop_size} (cumulative vop ratio: #{('%.2f' % (vop_ratio * 100))} %; average #{((elapsed / count) * 1000).to_i}ms)"
Severity: Minor
Found in Rakefile by rubocop

Line is too long. [84/80]
Open

      puts "Error, last block number was #{last_block_number}, did not expect #{n}."
Severity: Minor
Found in Rakefile by rubocop

Align else with if.
Open

  else
Severity: Minor
Found in Rakefile by rubocop

This cops checks the alignment of else keywords. Normally they should be aligned with an if/unless/while/until/begin/def keyword, but there are special cases when they should follow the same rules as the alignment of end.

Example:

# bad
if something
  code
 else
  code
end

# bad
if something
  code
 elsif something
  code
end

# good
if something
  code
else
  code
end

Space inside } missing.
Open

  options = {chain: chain, persist: persist, url: url, use_condenser_namespace: false}
Severity: Minor
Found in Rakefile 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 Rakefile by rubocop

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

        if !!error
Severity: Minor
Found in Rakefile 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.

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

  if !!response.result
Severity: Minor
Found in Rakefile 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.

Space inside } missing.
Open

  options = {chain: chain, wif: posting_wif, url: url}
Severity: Minor
Found in Rakefile 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 }}

Line is too long. [85/80]
Open

desc 'Tests the ability to stream live data. defaults: chain = hive; persist = true.'
Severity: Minor
Found in Rakefile by rubocop

There are no issues that match your filters.

Category
Status