danini-the-panini/mittsu-opengl

View on GitHub
lib/mittsu/opengl/renderer.rb

Summary

Maintainability
F
1 wk
Test Coverage
C
79%

Class has too many lines. [701/250]
Open

  class OpenGL::Renderer
    attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
      :gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
      :max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state

Severity: Minor
Found in lib/mittsu/opengl/renderer.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

File renderer.rb has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'opengl'
require 'glfw'
require 'fiddle'

require 'mittsu/opengl/version'
Severity: Major
Found in lib/mittsu/opengl/renderer.rb - About 1 day to fix

    Class Renderer has 77 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class OpenGL::Renderer
        attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
          :gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
          :max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state
    
    
    Severity: Major
    Found in lib/mittsu/opengl/renderer.rb - About 1 day to fix

      Method has too many lines. [97/30]
      Open

          def load_uniforms_generic(uniforms)
            uniforms.each do |(uniform, location)|
              # needs_update property is not added to all uniforms.
              next if uniform.needs_update == false || location == -1
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/renderer.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method load_uniforms_generic has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

          def load_uniforms_generic(uniforms)
            uniforms.each do |(uniform, location)|
              # needs_update property is not added to all uniforms.
              next if uniform.needs_update == false || location == -1
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/renderer.rb - About 6 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Cyclomatic complexity for load_uniforms_generic is too high. [33/6]
      Open

          def load_uniforms_generic(uniforms)
            uniforms.each do |(uniform, location)|
              # needs_update property is not added to all uniforms.
              next if uniform.needs_update == false || location == -1
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/renderer.rb by rubocop

      This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

      An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

      Method has too many lines. [57/30]
      Open

          def set_program(camera, lights, fog, material, object)
            @_used_texture_units = 0
            if material.needs_update?
              deallocate_material(material) if material.program
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/renderer.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method load_uniforms_generic has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def load_uniforms_generic(uniforms)
            uniforms.each do |(uniform, location)|
              # needs_update property is not added to all uniforms.
              next if uniform.needs_update == false || location == -1
      
      
      Severity: Major
      Found in lib/mittsu/opengl/renderer.rb - About 3 hrs to fix

        Method set_program has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            def set_program(camera, lights, fog, material, object)
              @_used_texture_units = 0
              if material.needs_update?
                deallocate_material(material) if material.program
        
        
        Severity: Minor
        Found in lib/mittsu/opengl/renderer.rb - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method update_object has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            def update_object(object)
              geometry = object.geometry
        
              if geometry.is_a? BufferGeometry
                # TODO: geometry vertex array ?????
        Severity: Minor
        Found in lib/mittsu/opengl/renderer.rb - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Cyclomatic complexity for set_program is too high. [18/6]
        Open

            def set_program(camera, lights, fog, material, object)
              @_used_texture_units = 0
              if material.needs_update?
                deallocate_material(material) if material.program
        
        
        Severity: Minor
        Found in lib/mittsu/opengl/renderer.rb by rubocop

        This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

        An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

        Method set_program has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def set_program(camera, lights, fog, material, object)
              @_used_texture_units = 0
              if material.needs_update?
                deallocate_material(material) if material.program
        
        
        Severity: Major
        Found in lib/mittsu/opengl/renderer.rb - About 2 hrs to fix

          Cyclomatic complexity for render_buffer is too high. [10/6]
          Open

              def render_buffer(camera, lights, fog, material, geometry_group, object)
                puts "--- RENDER #{object.name}" if DEBUG
                return unless material.visible
          
                geometry_group.renderer = self
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb by rubocop

          This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

          An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

          Method render_objects has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def render_objects(render_list, camera, lights, fog, override_material)
                material = nil
                render_list.each do |opengl_object|
                  puts "-- RENDER_OBJECT #{opengl_object.name}" if DEBUG
                  object = opengl_object.object
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method render_objects_immediate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def render_objects_immediate(render_list, material_type, camera, lights, fog, override_material)
                material = nil
                render_list.each do |opengl_object|
                  object = opengl_object.object
                  if object.visible
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Cyclomatic complexity for update_object is too high. [9/6]
          Open

              def update_object(object)
                geometry = object.geometry
          
                if geometry.is_a? BufferGeometry
                  # TODO: geometry vertex array ?????
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb by rubocop

          This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

          An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

          Cyclomatic complexity for render is too high. [7/6]
          Open

              def render(scene, camera, render_target = default_target, force_clear = false)
                raise "ERROR: Mittsu::OpenGL::Renderer#render: camera is not an instance of Mittsu::Camera" unless camera.is_a?(Camera)
          
                reset_cache_for_this_frame
          
          
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb by rubocop

          This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

          An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

          Method unroll_buffer_material has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def unroll_buffer_material(opengl_object)
                object = opengl_object.object
                buffer = opengl_object.buffer
          
                geometry = object.geometry
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method render_buffer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def render_buffer(camera, lights, fog, material, geometry_group, object)
                puts "--- RENDER #{object.name}" if DEBUG
                return unless material.visible
          
                geometry_group.renderer = self
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method render_buffer has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def render_buffer(camera, lights, fog, material, geometry_group, object)
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 45 mins to fix

            Method render_objects_immediate has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def render_objects_immediate(render_list, material_type, camera, lights, fog, override_material)
            Severity: Minor
            Found in lib/mittsu/opengl/renderer.rb - About 45 mins to fix

              Method set_program has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def set_program(camera, lights, fog, material, object)
              Severity: Minor
              Found in lib/mittsu/opengl/renderer.rb - About 35 mins to fix

                Method render_objects has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def render_objects(render_list, camera, lights, fog, override_material)
                Severity: Minor
                Found in lib/mittsu/opengl/renderer.rb - About 35 mins to fix

                  Method render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def render(scene, camera, render_target = default_target, force_clear = false)
                        raise "ERROR: Mittsu::OpenGL::Renderer#render: camera is not an instance of Mittsu::Camera" unless camera.is_a?(Camera)
                  
                        reset_cache_for_this_frame
                  
                  
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb - About 35 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Avoid parameter lists longer than 5 parameters. [6/5]
                  Open

                      def render_buffer(camera, lights, fog, material, geometry_group, object)
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by rubocop

                  This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                  Avoid parameter lists longer than 5 parameters. [6/5]
                  Open

                      def render_objects_immediate(render_list, material_type, camera, lights, fog, override_material)
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by rubocop

                  This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

                  TODO found
                  Open

                        # TODO: load extensions??
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                      # TODO: get_context ???
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO framebuffer logic for render target cube
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: when morphing is implemented
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                      # TODO: force_context_loss ???
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  FIXME found
                  Open

                      # FIXME: refactor
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                      # TODO: supports[half|standard|compressed|blend min max] ... ???
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: scale the image ...
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: geometry vertex array ?????
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                      # TODO: supports_float_textures? ???
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                            # TODO
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: when OpenGLRenderTargetCube exists
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: needs extensions.get ...
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: get max anisotropy ????
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: when skinning is implemented. Then also refactor
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: when all of these things exist
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        @_supports_bone_textures = @_supports_vertex_textures && false # TODO: extensions.get('OES_texture_float') ????
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: when SkinnedMesh is defined
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                              uniform.array ||= value.flat_map(&:to_a) # TODO: Float32Array
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                                # TODO: make a GL.BufferSubData_easy method
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: handle losing opengl context??
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                          # TODO: when fog is implemented
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: when these custom plugins are implemented
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                              uniform.array ||= value.flat_map(&:to_a) # TODO: Float32Array
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  FIXME found
                  Open

                      # FIXME: refactor
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                            # TODO: when OpenGLRenderTargetCube is defined
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                              uniform.array ||= value.flat_map(&:to_a) # TODO: Float32Array
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  TODO found
                  Open

                        # TODO: when these custom plugins are implemented
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  FIXME found
                  Open

                      # FIXME: REFACTOR!?!?!?!?!???
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by fixme

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          when :'mat3[]'
                            if value.first.is_a? Matrix3
                              uniform.array ||= Array.new(9 * value.length) # Float32Array
                  
                              value.each_with_index do |v, i|
                  Severity: Major
                  Found in lib/mittsu/opengl/renderer.rb and 1 other location - About 1 hr to fix
                  lib/mittsu/opengl/renderer.rb on lines 680..690

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 51.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          when :'mat4[]'
                            if value.first.is_a? Matrix4
                              uniform.array ||= Array.new(16 * value.length) # Float32Array
                  
                              value.each_with_index do |v, i|
                  Severity: Major
                  Found in lib/mittsu/opengl/renderer.rb and 1 other location - About 1 hr to fix
                  lib/mittsu/opengl/renderer.rb on lines 668..678

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 51.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  end at 392, 12 is not aligned with case at 388, 23.
                  Open

                              end
                  Severity: Minor
                  Found in lib/mittsu/opengl/renderer.rb by rubocop

                  This cop checks whether the end keywords are aligned properly.

                  Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

                  If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

                  If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

                  If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

                  Example: EnforcedStyleAlignWith: keyword (default)

                  # bad
                  
                  variable = if true
                      end
                  
                  # good
                  
                  variable = if true
                             end

                  Example: EnforcedStyleAlignWith: variable

                  # bad
                  
                  variable = if true
                      end
                  
                  # good
                  
                  variable = if true
                  end

                  Example: EnforcedStyleAlignWith: startofline

                  # bad
                  
                  variable = if true
                      end
                  
                  # good
                  
                  puts(if true
                  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 - 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

                  There are no issues that match your filters.

                  Category
                  Status