danini-the-panini/mittsu-opengl

View on GitHub

Showing 251 of 251 total issues

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

    def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
Severity: Minor
Found in lib/mittsu/opengl_implementation/objects/mesh.rb - About 45 mins to fix

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

        def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
    Severity: Minor
    Found in lib/mittsu/opengl_implementation/objects/point_cloud.rb - About 45 mins to fix

      Method init_geometry_groups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def init_geometry_groups(object)
            material = object.material
            add_buffers = false
      
            if @groups.nil? || @groups_need_update
      Severity: Minor
      Found in lib/mittsu/opengl_implementation/core/geometry.rb - About 45 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 deeply nested control flow statements.
      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
      Severity: Major
      Found in lib/mittsu/opengl_implementation/textures/cube_texture.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  elsif custom_attribute[:size] == 4
                    if custom_attribute[:bound_to].nil? || custom_attribute[:bound_to] == :vertices
                      @faces3.each do |chf|
                        face = obj_faces[chf]
        
        
        Severity: Major
        Found in lib/mittsu/opengl/geometry_group.rb - About 45 mins to fix

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

              def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
          Severity: Minor
          Found in lib/mittsu/opengl_implementation/objects/line.rb - About 45 mins to fix

            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 update_specific has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def update_specific
                    gl_format = GL::MITTSU_PARAMS[format]
                    gl_type = GL::MITTSU_PARAMS[type]
              
                    mipmaps.each_with_index do |mipmap, i|
              Severity: Minor
              Found in lib/mittsu/opengl_implementation/textures/compressed_texture.rb - About 45 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

              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

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

                                    custom_attribute.array[offset]     = value.x
                                    custom_attribute.array[offset + 1] = value.y
                                    custom_attribute.array[offset + 2] = value.z
                                    custom_attribute.array[offset + 3] = value.w
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 35 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 166..172

                    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 35.

                    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

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

                        def set_polygon_offset(polygon_offset, factor, units)
                          if @current_polygon_offset != polygon_offset
                            if polygon_offset
                              GL.Enable(GL::POLYGON_OFFSET_FILL)
                            else
                    Severity: Minor
                    Found in lib/mittsu/opengl/state.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

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

                                  custom_attribute.array[offset    ] = value.x
                                  custom_attribute.array[offset + 1] = value.y
                                  custom_attribute.array[offset + 2] = value.z
                                  custom_attribute.array[offset + 3] = value.w
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 35 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 247..253

                    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 35.

                    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

                    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. [7/5]
                    Open

                        def set_blending(blending, blend_equation = nil, blend_src = nil, blend_dst = nil, blend_equation_alpha = nil, blend_src_alpha = nil, blend_dst_alpha = nil)
                    Severity: Minor
                    Found in lib/mittsu/opengl/state.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.

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

                                    custom_attribute.value.each do |value|
                                      custom_attribute.array[offset]     = value.r
                                      custom_attribute.array[offset + 1] = value.g
                                      custom_attribute.array[offset + 2] = value.b
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 30 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 237..243

                    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 32.

                    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

                                    custom_attribute.value.each do |value|
                                      custom_attribute.array[offset]     = value.x
                                      custom_attribute.array[offset + 1] = value.y
                                      custom_attribute.array[offset + 2] = value.z
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 30 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 229..235

                    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 32.

                    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

                                  values.each do |value|
                                    custom_attribute.array[offset    ] = value.x
                                    custom_attribute.array[offset + 1] = value.y
                                    custom_attribute.array[offset + 2] = value.z
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 25 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 148..154

                    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 31.

                    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

                                  values.each do |value|
                                    custom_attribute.array[offset    ] = value.r
                                    custom_attribute.array[offset + 1] = value.g
                                    custom_attribute.array[offset + 2] = value.b
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb and 1 other location - About 25 mins to fix
                    lib/mittsu/opengl_implementation/core/geometry.rb on lines 156..162

                    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 31.

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language