Showing 659 of 659 total issues
Do not use prefix _
for a variable that is used. Open
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
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 block argument - s
. You can omit the argument if you don't care about it. Open
Open
if [:index, :position, :normal, :uv].any { |s| !@attributes.has_key?}
- 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
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
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
Useless assignment to variable - value
. Use +
instead of +=
. Open
Open
value += 1
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
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
Open
while line = read_line(stream)
- 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
TODO found Open
Open
# TODO: when OpenGLRenderTargetCube exists
- Exclude checks
TODO found Open
Open
# TODO: populate with extension parameters?
- Exclude checks
FIXME found Open
Open
# TODO!!! FIXME!!!
- Exclude checks
FIXME found Open
Open
# TODO!!! FIXME!!!
- Exclude checks
TODO found Open
Open
# MeshDepthMaterial => :depth, # TODO...
- Exclude checks
XXX found Open
Open
sorted_indices [index_ptr] = new_vid - offset.index # XXX: overflows at 16bit
- Exclude checks
TODO found Open
Open
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- Exclude checks
TODO found Open
Open
fragColor = vec4( outgoingLight, diffuseColor.a ); // TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects
- Exclude checks
FIXME found Open
Open
# FIXME: refactor
- Exclude checks
FIXME found Open
Open
# FIXME: refactor
- Exclude checks
TODO found Open
Open
# LineDashedMaterial => :dashed, # TODO...
- Exclude checks
HACK found Open
Open
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
- Exclude checks
TODO found Open
Open
# TODO: force_context_loss ???
- Exclude checks