GordonDiggs/rayons

View on GitHub
app/models/item_stats.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

    stats.select { |k,v| v > 10 }.merge("Other" => others)
Severity: Minor
Found in app/models/item_stats.rb 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

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

    others = stats.select { |k,v| v <= 10 }.count
Severity: Minor
Found in app/models/item_stats.rb 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

Space missing after comma.
Open

    others = stats.select { |k,v| v <= 10 }.count
Severity: Minor
Found in app/models/item_stats.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

Space missing after comma.
Open

    stats.select { |k,v| v > 10 }.merge("Other" => others)
Severity: Minor
Found in app/models/item_stats.rb by rubocop

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

There are no issues that match your filters.

Category
Status