danini-the-panini/mittsu

View on GitHub

Showing 659 of 659 total issues

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

      unless @object&.name.nil?
Severity: Minor
Found in lib/mittsu/loaders/obj_loader.rb by rubocop

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

end
Severity: Minor
Found in lib/mittsu/loaders/obj_loader.rb by rubocop

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

        @@handlers.find(-> () { [nil, nil] }) { |regex, loader| regex =~ file }[1]
Severity: Minor
Found in lib/mittsu/loaders/loader.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 - morph_target. If it's necessary, use _ or _morph_target as an argument name to indicate that it won't be used.
Open

      @morph_targets.each_with_index do |morph_target, i|
Severity: Minor
Found in lib/mittsu/core/geometry.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 tLABEL (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

        materials: ([jsonify_material] + children.map { |x| x[:materials] }).flatten.compact
Severity: Minor
Found in lib/mittsu/core/object_3d.rb by rubocop

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/renderers/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 - 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|

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 - postition. You can omit the argument if you don't care about it.
Open

            positions.each_slice(3) do |postition|
Severity: Minor
Found in lib/mittsu/math/box3.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

Do not use prefix _ for a variable that is used.
Open

      _x, _y, _z = *@elements
Severity: Minor
Found in lib/mittsu/math/vector3.rb by rubocop

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 - f. If it's necessary, use _ or _f as an argument name to indicate that it won't be used.
Open

      @faces.each_with_index do |face, f|
Severity: Minor
Found in lib/mittsu/core/geometry.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

          geometry: @geometry&.uuid,
Severity: Minor
Found in lib/mittsu/core/object_3d.rb by rubocop

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

          name: @name&.empty? ? nil : @name,
Severity: Minor
Found in lib/mittsu/core/object_3d.rb by rubocop

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

          visible: @visible ? nil : @visible,
Severity: Minor
Found in lib/mittsu/core/object_3d.rb by rubocop

Unused block argument - mateiral. You can omit the argument if you don't care about it.
Open

      MeshFaceMaterial.new.tap do |mateiral|

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

        @mouse_button_callback = ::GLFW::create_callback(:GLFWmousebuttonfun) do |window_handle, button, action, mods|
Severity: Minor
Found in lib/mittsu/renderers/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 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

Do not use prefix _ for a variable that is used.
Open

      _x, _y, _z, _w = *@elements
Severity: Minor
Found in lib/mittsu/math/vector4.rb by rubocop

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 - angle. Use _ or _angle as a variable name to indicate that it won't be used.
Open

      angle, x1, y1, z1 = nil    # variables for result
Severity: Minor
Found in lib/mittsu/math/vector4.rb by rubocop

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

Do not use prefix _ for a variable that is used.
Open

      _x, _y, _z, _w = @x, @y, @z, @w
Severity: Minor
Found in lib/mittsu/math/quaternion.rb by rubocop

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

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
Severity
Category
Status
Source
Language