danini-the-panini/mittsu-opengl

View on GitHub

Showing 67 of 251 total issues

Method set_mesh_buffers has 438 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def set_mesh_buffers(object, hint, should_dispose, material)
      return unless @initted_arrays

      geometry = object.geometry

Severity: Major
Found in lib/mittsu/opengl/geometry_group.rb - About 2 days to fix

    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

      Method set_mesh_buffers has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
      Open

          def set_mesh_buffers(object, hint, should_dispose, material)
            return unless @initted_arrays
      
            geometry = object.geometry
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/geometry_group.rb - About 1 day 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

      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

        File geometry_group.rb has 567 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'mittsu/opengl/geometry_like'
        
        module Mittsu
          class OpenGL::GeometryGroup
            include OpenGL::GeometryLike
        Severity: Major
        Found in lib/mittsu/opengl/geometry_group.rb - About 1 day to fix

          Method set has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

              def set(slot, renderer)
                @renderer = renderer
          
                if image.length == 6
                  if needs_update?
          Severity: Minor
          Found in lib/mittsu/opengl_implementation/textures/cube_texture.rb - About 1 day 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 initialize has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

                def initialize(width, height, title, antialias: 0)
                  ::GLFW.Init
          
                  ::GLFW.WindowHint ::GLFW::OPENGL_PROFILE, ::GLFW::OPENGL_CORE_PROFILE
                  ::GLFW.WindowHint ::GLFW::OPENGL_FORWARD_COMPAT, GL::TRUE
          Severity: Minor
          Found in lib/mittsu/glfw/window.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

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

              def render(scene, camera)
                return unless @renderer.shadow_map_enabled
          
                lights = []
                fog = nil
          Severity: Minor
          Found in lib/mittsu/opengl/plugins/shadow_map_plugin.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

          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

          Method render has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def render(scene, camera)
                return unless @renderer.shadow_map_enabled
          
                lights = []
                fog = nil
          Severity: Major
          Found in lib/mittsu/opengl/plugins/shadow_map_plugin.rb - About 4 hrs to fix

            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

              Class Window has 28 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Window
                    attr_accessor :key_press_handler, :key_release_handler, :key_repeat_handler, :char_input_handler, :cursor_pos_handler, :mouse_button_press_handler, :mouse_button_release_handler, :scroll_handler, :framebuffer_size_handler
              
                    def initialize(width, height, title, antialias: 0)
                      ::GLFW.Init
              Severity: Minor
              Found in lib/mittsu/glfw/window.rb - About 3 hrs to fix

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

                    def setup_buffers
                      return unless @framebuffer.nil?
                
                      # TODO: when OpenGLRenderTargetCube exists
                      is_cube = false # render_target.is_a? OpenGLRenderTargetCube
                Severity: Minor
                Found in lib/mittsu/opengl_implementation/textures/render_target.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

                Method set_particle_buffers has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def set_particle_buffers(hint)
                      if @vertices_need_update
                        @vertices.each_with_index do |vertex, v|
                          offset = v * 3
                
                
                Severity: Minor
                Found in lib/mittsu/opengl_implementation/core/geometry.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 set_line_buffers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def set_line_buffers(hint)
                      if @vertices_need_update
                        @vertices.each_with_index do |vertex, v|
                          offset = v * 3
                
                
                Severity: Major
                Found in lib/mittsu/opengl_implementation/core/geometry.rb - About 2 hrs to fix

                  Method init_mesh_buffers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def init_mesh_buffers(object)
                        geometry = object.geometry
                  
                        nvertices = @faces3.length * 3
                        nvertices2 = nvertices * 2
                  Severity: Major
                  Found in lib/mittsu/opengl/geometry_group.rb - About 2 hrs to fix

                    Method set_particle_buffers has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def set_particle_buffers(hint)
                          if @vertices_need_update
                            @vertices.each_with_index do |vertex, v|
                              offset = v * 3
                    
                    
                    Severity: Major
                    Found in lib/mittsu/opengl_implementation/core/geometry.rb - About 2 hrs to fix

                      File shadow_map_plugin.rb has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'mittsu/math'
                      
                      module Mittsu
                        class ShadowMapPlugin
                          def initialize(renderer, lights, opengl_objects, opengl_objects_immediate)
                      Severity: Minor
                      Found in lib/mittsu/opengl/plugins/shadow_map_plugin.rb - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language