Showing 251 of 251 total issues
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
Redundant use of Object#to_s
in interpolation. Open
file_name = "#{key.to_s}.glsl"
- Read upRead up
- Exclude checks
This cop checks for string conversion in string interpolation, which is redundant.
Example:
# bad
"result is #{something.to_s}"
Example:
# good
"result is #{something}"
Unused block argument - chf
. You can omit the argument if you don't care about it. Open
@faces3.each do |chf|
- 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
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
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
Literal false
appeared as a condition. Open
if false # material.is_a?(RawShaderMaterial) # TODO: when RawShaderMaterial exists
- Read upRead up
- Exclude checks
This cop checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until.
Example:
# bad
if 20
do_something
end
Example:
# bad
if some_var && true
do_something
end
Example:
# good
if some_var && some_condition
do_something
end
Unused block argument - m
. You can omit the argument if you don't care about it. Open
num_morph_targets.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
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 method argument - material
. If it's necessary, use _
or _material
as an argument name to indicate that it won't be used. Open
def update_uv_buffers(uv_attribute, uv2_attribute, object, material)
- 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 - v
. If it's necessary, use _
or _v
as an argument name to indicate that it won't be used. Open
value.each_with_index do |v, i|
- 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
Unused block argument - window_handle
. If it's necessary, use _
or _window_handle
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
Unused block argument - mods
. If it's necessary, use _
or _mods
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
unexpected token error
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
@_path ||= find_match&.to_s
- Exclude checks
Unused block argument - v
. If it's necessary, use _
or _v
as an argument name to indicate that it won't be used. Open
uniforms.each do |k, v|
- 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
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
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
Avoid more than 4 levels of block nesting. Open
if @renderer.compressed_texture_formats.include?(gl_format)
GL.CompressedTexImage2D(GL::TEXTURE_CUBE_MAP_POSITIVE_X + i, j, gl_format, mipmap.width, mipmap.height, 0, mipmap.data)
else
puts "WARNING: Mittsu::OpenGLCubeTexture: Attempt to load unsupported compressed texture format in #set"
end
- Read upRead up
- Exclude checks
This cop checks for excessive nesting of conditional and looping constructs.
You can configure if blocks are considered using the CountBlocks
option. When set to false
(the default) blocks are not counted
towards the nesting level. Set to true
to count blocks as well.
The maximum level of nesting allowed is configurable.
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
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
Unused block argument - v
. If it's necessary, use _
or _v
as an argument name to indicate that it won't be used. Open
value.each_with_index do |v, i|
- 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