danini-the-panini/mittsu

View on GitHub

Showing 226 of 659 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/renderers/opengl/opengl_geometry_group.rb - About 2 days to fix

    Method raycast has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
    Open

        def raycast(raycaster, intersects)
          @_inverse_matrix ||= Matrix4.new
          @_ray ||= Ray.new
          @_sphere ||= Sphere.new
    
    
    Severity: Minor
    Found in lib/mittsu/objects/mesh.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

    File opengl_renderer.rb has 728 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'opengl'
    require 'glfw'
    require 'fiddle'
    
    require 'mittsu/renderers/opengl/opengl_lib'
    Severity: Major
    Found in lib/mittsu/renderers/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/renderers/opengl/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 OpenGLRenderer has 77 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class OpenGLRenderer
          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/renderers/opengl_renderer.rb - About 1 day to fix

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

        require 'mittsu/renderers/opengl/opengl_geometry_like'
        
        module Mittsu
          class OpenGLGeometryGroup
            include OpenGLGeometryLike
        Severity: Major
        Found in lib/mittsu/renderers/opengl/opengl_geometry_group.rb - About 1 day to fix

          File matrix4.rb has 534 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Mittsu
            class Matrix4
              attr_accessor :elements
          
              DIMENSIONS = 4
          Severity: Major
          Found in lib/mittsu/math/matrix4.rb - About 1 day to fix

            File geometry.rb has 525 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'securerandom'
            
            module Mittsu
              class Geometry
                include EventDispatcher
            Severity: Major
            Found in lib/mittsu/core/geometry.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/renderers/opengl/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

              File buffer_geometry.rb has 503 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'securerandom'
              require 'mittsu/core/event_dispatcher'
              
              module Mittsu
                class BufferGeometry
              Severity: Major
              Found in lib/mittsu/core/buffer_geometry.rb - About 1 day to fix

                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/renderers/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 raycast has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                    def raycast(raycaster, intersects)
                      precision = raycaster.line_precision
                      precision_sq = precision * precision
                
                      @geometry.compute_bounding_sphere if @geometry.bounding_sphere.nil?
                Severity: Minor
                Found in lib/mittsu/objects/line.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/renderers/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/renderers/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

                Class Vector has 42 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class Vector
                    attr_accessor :elements, :uv, :index
                
                    def initialize(elements)
                      @elements = elements
                Severity: Minor
                Found in lib/mittsu/math/vector.rb - About 5 hrs to fix

                  Method raycast has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def raycast(raycaster, intersects)
                        @_inverse_matrix ||= Matrix4.new
                        @_ray ||= Ray.new
                        @_sphere ||= Sphere.new
                  
                  
                  Severity: Major
                  Found in lib/mittsu/objects/mesh.rb - About 5 hrs to fix

                    Class Object3D has 41 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Object3D
                        include EventDispatcher
                    
                        attr_accessor :children, :up, :position, :rotation, :quaternion, :scale, :rotation_auto_update, :matrix, :matrix_world, :matrix_auto_update, :matrix_world_needs_update, :visible, :cast_shadow, :receive_shadow, :frustum_culled, :render_order, :user_data, :parent, :geometry
                    
                    
                    Severity: Minor
                    Found in lib/mittsu/core/object_3d.rb - About 5 hrs to fix

                      Class Vector3 has 41 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Vector3 < Vector
                          ELEMENTS = { x: 0, y: 1, z: 2 }
                          DIMENSIONS = ELEMENTS.count
                      
                          def initialize(x = 0, y = 0, z = 0)
                      Severity: Minor
                      Found in lib/mittsu/math/vector3.rb - About 5 hrs to fix

                        Method from_buffer_geometry has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def from_buffer_geometry(geometry)
                              scope = self
                              vertices = geometry[:position].array
                              indices = geometry[:index].nil? ? nil : geometry[:index].array
                              normals = geometry[:normal].nil? ? nil : geometry[:normal].array
                        Severity: Minor
                        Found in lib/mittsu/core/geometry.rb - About 5 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 create_material has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def create_material(m, texture_path)
                              # defaults
                        
                              mtype = 'MeshLambertMaterial'
                              mpars = {
                        Severity: Minor
                        Found in lib/mittsu/loaders/loader.rb - About 5 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

                        Severity
                        Category
                        Status
                        Source
                        Language