danini-the-panini/mittsu-opengl

View on GitHub

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|
Severity: Minor
Found in lib/mittsu/glfw/window.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

Redundant use of Object#to_s in interpolation.
Open

      file_name = "#{key.to_s}.glsl"
Severity: Minor
Found in lib/mittsu/opengl/shader/chunk.rb by rubocop

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|
Severity: Minor
Found in lib/mittsu/opengl/geometry_group.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 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)

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)

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
Severity: Minor
Found in lib/mittsu/opengl/program.rb by rubocop

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|
Severity: Minor
Found in lib/mittsu/opengl/geometry_group.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 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)

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)
Severity: Minor
Found in lib/mittsu/opengl/geometry_like.rb by rubocop

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|
Severity: Minor
Found in lib/mittsu/opengl/renderer.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 - 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|
Severity: Minor
Found in lib/mittsu/glfw/window.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 - 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|
Severity: Minor
Found in lib/mittsu/glfw/window.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

unexpected token error (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

          @_path ||= find_match&.to_s
Severity: Minor
Found in lib/mittsu/glfw/lib.rb by rubocop

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|
Severity: Minor
Found in lib/mittsu/opengl/program.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

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

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|
Severity: Minor
Found in lib/mittsu/opengl/geometry_group.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

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

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)

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)

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|
Severity: Minor
Found in lib/mittsu/opengl/renderer.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
Severity
Category
Status
Source
Language