inertia186/radiator

View on GitHub
lib/radiator/type/beneficiaries.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for to_bytes is too high. [23.02/15]
Open

      def to_bytes
    #set sz 1,  op type 0, see
    #https://github.com/steemit/steem-js/blob/733332d09582e95c0ea868a6ac5b6ee8a1f115ee/src/auth/serializer/src/operations.js#L355
    varint(1) + varint(0) + varint(@value.size) + @value.map do |b|
      case b
Severity: Minor
Found in lib/radiator/type/beneficiaries.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

Tab detected.
Open

    #set sz 1,  op type 0, see
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

Trailing whitespace detected.
Open

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

Space inside { missing.
Open

          else; {account: b.keys.first, weight: b.values.first}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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

          else; {account: b.keys.first, weight: b.values.first}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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/type/beneficiaries.rb by rubocop

Trailing whitespace detected.
Open

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

Space inside } missing.
Open

          when ::Array then {account: b.first, weight: b.last}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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 }}

Tab detected.
Open

      when ::Array then pakStr(b.first.to_s) + pakS(b.last)
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

end at 16, 10 is not aligned with case at 13, 3.
Open

          end
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb 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)

Tab detected.
Open

    varint(1) + varint(0) + varint(@value.size) + @value.map do |b|
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

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

    varint(1) + varint(0) + varint(@value.size) + @value.map do |b|
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb 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

Missing top-level class documentation comment.
Open

    class Beneficiaries < Serializer
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Tab detected.
Open

    #https://github.com/steemit/steem-js/blob/733332d09582e95c0ea868a6ac5b6ee8a1f115ee/src/auth/serializer/src/operations.js#L355
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

Space inside { missing.
Open

        {@key => v}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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/type/beneficiaries.rb by rubocop

Missing space after #.
Open

    #set sz 1,  op type 0, see
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Space inside { missing.
Open

          when ::Array then {account: b.first, weight: b.last}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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/type/beneficiaries.rb by rubocop

Missing space after #.
Open

    #https://github.com/steemit/steem-js/blob/733332d09582e95c0ea868a6ac5b6ee8a1f115ee/src/auth/serializer/src/operations.js#L355
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

Example:

# bad
#Some comment

# good
# Some comment

Tab detected.
Open

      case b
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

Space inside } missing.
Open

        {@key => v}
Severity: Minor
Found in lib/radiator/type/beneficiaries.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 }}

Tab detected.
Open

      else; pakStr(b.keys.first.to_s) + pakS(b.values.first)
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

Tab detected.
Open

    end.join
Severity: Minor
Found in lib/radiator/type/beneficiaries.rb by rubocop

There are no issues that match your filters.

Category
Status