danini-the-panini/mittsu

View on GitHub

Showing 226 of 659 total issues

Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def initialize(parameters = {})
      super()

        @type = 'MeshPhongMaterial'

Severity: Minor
Found in lib/mittsu/materials/mesh_phong_material.rb - About 1 hr to fix

    Method clone has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def clone
          material = MeshPhongMaterial.new
    
          super(material)
    
    
    Severity: Minor
    Found in lib/mittsu/materials/mesh_phong_material.rb - About 1 hr to fix

      Method load_uniforms has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def load_uniforms(uniforms, uniforms_lib)
              uniform_strings = nil;
              in_uniform = false
      
              uniforms.lines.map(&:strip).each_with_object({}) { |line, hash|
      Severity: Minor
      Found in lib/mittsu/renderers/shaders/rbsl_loader.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 raycast has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def raycast(raycaster, intersects)
            threshold = raycaster.params[:point_cloud][:threshold]
            @_inverse_matrix.inverse(self.matrix_world)
            @_ray.copy(raycaster.ray).apply_matrix4(@_inverse_matrix)
      
      
      Severity: Minor
      Found in lib/mittsu/objects/point_cloud.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 decompose has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def decompose(position, quaternion, scale)
            vector = Mittsu::Vector3.new
            matrix = Mittsu::Matrix4.new
            te = self.elements
            sx = vector.set(te[0], te[1],  te[2]).length
      Severity: Minor
      Found in lib/mittsu/math/matrix4.rb - About 1 hr to fix

        Method initialize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def initialize(color = nil, intensity = 1.0)
              super(color)
        
              @type = 'DirectionalLight'
        
        
        Severity: Minor
        Found in lib/mittsu/lights/directional_light.rb - About 1 hr to fix

          Method make_groups has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def make_groups(uses_face_material = false)
                max_vertices_in_group = 65535 # TODO: OES_element_index_uint ???
          
                hash_map = {}
          
          
          Severity: Minor
          Found in lib/mittsu/renderers/opengl/core/geometry.rb - About 1 hr to fix

            Method compute_vertex_normals has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def compute_vertex_normals(area_weighted = false)
                  vertices = Array.new(@vertices.length)
                  @vertices.length.times do |v|
                    vertices[v] = Mittsu::Vector3.new
                  end
            Severity: Minor
            Found in lib/mittsu/core/geometry.rb - About 1 hr to fix

              Method initialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def initialize
                    super
                    @id = (@@id ||= 1).tap { @@id += 1 }
              
                    @uuid = SecureRandom.uuid
              Severity: Minor
              Found in lib/mittsu/core/object_3d.rb - About 1 hr to fix

                Method initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def initialize(near, far, cube_resolution)
                      super()
                
                      @type = 'CubeCamera'
                
                
                Severity: Minor
                Found in lib/mittsu/cameras/cube_camera.rb - About 1 hr to fix

                  Method set has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def set(n11, n12, n13, n21, n22, n23, n31, n32, n33)
                  Severity: Major
                  Found in lib/mittsu/math/matrix3.rb - About 1 hr to fix

                    Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def initialize(video = nil, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1)
                    Severity: Major
                    Found in lib/mittsu/textures/video_texture.rb - About 1 hr to fix

                      Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def initialize(images = nil, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1)
                      Severity: Major
                      Found in lib/mittsu/textures/cube_texture.rb - About 1 hr to fix

                        Method initialize has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def initialize(image = DEFAULT_IMAGE, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1)
                        Severity: Major
                        Found in lib/mittsu/textures/texture.rb - About 1 hr to fix

                          Method initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def initialize(radius = 50.0, segments = 8, theta_start = 0.0, theta_length = (::Math::PI * 2.0))
                                super()
                          
                                @type = 'CircleGeometry'
                          
                          
                          Severity: Minor
                          Found in lib/mittsu/extras/geometries/circle_geometry.rb - About 1 hr to fix

                            Method cache_uniform_locations has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def cache_uniform_locations(uniforms, parameters)
                                  identifiers = [
                                    'viewMatrix',
                                    'modelViewMatrix',
                                    'projectionMatrix',
                            Severity: Minor
                            Found in lib/mittsu/renderers/opengl/opengl_program.rb - About 1 hr to fix

                              Method multiply_matrices has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def multiply_matrices(a, b)
                                    ae = a.elements
                                    be = b.elements
                                    te = self.elements
                                    a11 = ae[0]; a12 = ae[4]; a13 = ae[8];  a14 = ae[12]
                              Severity: Minor
                              Found in lib/mittsu/math/matrix4.rb - About 1 hr to fix

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

                                    def init_custom_attributes(object)
                                      material = object.material
                                
                                      nvertices = @vertices.length
                                
                                
                                Severity: Minor
                                Found in lib/mittsu/renderers/opengl/core/geometry.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 project has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def project(renderer)
                                      puts " --- PROJECT #{self.name}" if DEBUG
                                      @renderer = renderer
                                      return unless visible
                                      init
                                Severity: Minor
                                Found in lib/mittsu/renderers/opengl/core/object_3d.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

                                Severity
                                Category
                                Status
                                Source
                                Language