Showing 659 of 659 total issues
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
unexpected token tRCURLY
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
}.reject { |k,v| v.nil? || v == [] },
- Exclude checks
Unused method argument - update_buffers
. If it's necessary, use _
or _update_buffers
as an argument name to indicate that it won't be used. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused block argument - m
. You can omit the argument if you don't care about it. Open
num_morph_normals.times do |m|
- Read upRead up
- Exclude checks
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
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. Open
if @renderer.shadow_map_cull_face = CullFaceFront
- Read upRead up
- Exclude checks
This cop checks for assignments in the conditions of if/while/until.
Example:
# bad
if some_var = true
do_something
end
Example:
# good
if some_var == true
do_something
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Unused method argument - camera
. If it's necessary, use _
or _camera
as an argument name to indicate that it won't be used. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z, _w = @x, @y, @z, @w
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
unexpected token tCOMMA
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
}.reject { |k,v| v.nil? || v == [] },
- Exclude checks
Unused method argument - lights
. If it's necessary, use _
or _lights
as an argument name to indicate that it won't be used. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Unused block argument - scancode
. If it's necessary, use _
or _scancode
as an argument name to indicate that it won't be used. Open
@key_callback = ::GLFW::create_callback(:GLFWkeyfun) do |window_handle, key, scancode, action, mods|
- Read upRead up
- Exclude checks
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
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Do not use prefix _
for a variable that is used. Open
_x, _y, _z = *@elements
- Read upRead up
- Exclude checks
This cop checks for underscore-prefixed variables that are actually used.
Example:
# bad
[1, 2, 3].each do |_num|
do_something(_num)
end
Example:
# good
[1, 2, 3].each do |num|
do_something(num)
end
Example:
# good
[1, 2, 3].each do |_num|
do_something # not using `_num`
end
Unused method argument - fog
. If it's necessary, use _
or _fog
as an argument name to indicate that it won't be used. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end