danini-the-panini/mittsu

View on GitHub

Showing 226 of 659 total issues

Method initialize has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def initialize(vertices, indices, radius = 1.0, detail = 0)
      super()

      @type = 'PolyhedronGeometry'

Severity: Minor
Found in lib/mittsu/extras/geometries/polyhedron_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 subdivide has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def subdivide(face, detail)
      cols = 2.0 ** detail
      a = prepare(@vertices[face.a])
      b = prepare(@vertices[face.b])
      c = prepare(@vertices[face.c])
Severity: Minor
Found in lib/mittsu/extras/geometries/polyhedron_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 compute_vertex_normals has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_vertex_normals
      if self[:position]
        positions = self[:position].array
        if self[:normal].nil?
          self[:normal] = Mittsu::BufferAttribute.new(Array.new(positions.length), 3)
Severity: Minor
Found in lib/mittsu/core/buffer_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 raycast has 47 lines of code (exceeds 25 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

    Method compute_morph_normals has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def compute_morph_normals
          # save original normals
          # - create temp variables on first access
          #   otherwise just copy (for faster repeated calls)
          @_original_face_normal ||= []
    Severity: Minor
    Found in lib/mittsu/core/geometry.rb - About 1 hr to fix

      Method merge has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def merge(geometry, matrix = nil, material_index_offset = nil)
            if !geometry.is_a? Mittsu::Geometry
              puts('ERROR: Mittsu::Geometry#merge: geometry not an instance of Mittsu::Geometry.', geometry.inspect)
              return
            end
      Severity: Minor
      Found in lib/mittsu/core/geometry.rb - About 1 hr to fix

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

            def initialize(inner_radius = 0.0, outer_radius = 50.0, theta_segments = 8, phi_segments = 8, theta_start = 0.0, theta_length = (::Math::PI * 2.0))
              super()
        
              @type = 'RingGeometry'
        
        
        Severity: Minor
        Found in lib/mittsu/extras/geometries/ring_geometry.rb - About 1 hr to fix

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

              def initialize(vertices, indices, radius = 1.0, detail = 0)
                super()
          
                @type = 'PolyhedronGeometry'
          
          
          Severity: Minor
          Found in lib/mittsu/extras/geometries/polyhedron_geometry.rb - About 1 hr to fix

            Method initialize has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                def initialize(func, slices, stacks)
                  super()
            
                  @type = 'ParametricBufferGeometry'
            
            
            Severity: Minor
            Found in lib/mittsu/extras/geometries/parametric_buffer_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 program_parameters has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def program_parameters(lights, fog, object)
                  # heuristics to create shader paramaters according to lights in the scene
                  # (not to blow over max_lights budget)
            
                  max_light_count = allocate_lights(lights)
            Severity: Minor
            Found in lib/mittsu/renderers/opengl/materials/material.rb - About 1 hr to fix

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

                  def initialize(radius = 100.0, tube = 40.0, radial_segments = 8, tubular_segments = 6, arc = (::Math::PI * 2.0))
                    super()
              
                    @type = 'TorusGeometry'
              
              
              Severity: Minor
              Found in lib/mittsu/extras/geometries/torus_geometry.rb - About 1 hr to fix

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

                    def initialize(camera)
                      @_vector = Vector3.new
                      @_camera = Camera.new
                
                      @geometry = Geometry.new
                Severity: Minor
                Found in lib/mittsu/extras/helpers/camera_helper.rb - About 1 hr to fix

                  Method set_blending has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  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)
                        if blending != @current_blending
                          case blending
                          when NoBlending
                            GL.Disable(GL::BLEND)
                  Severity: Minor
                  Found in lib/mittsu/renderers/opengl/opengl_state.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 jsonify has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def jsonify
                        children = @children.map(&:to_json)
                        {
                          object: {
                            uuid: @uuid,
                  Severity: Minor
                  Found in lib/mittsu/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

                  Method setup_buffers has 39 lines of code (exceeds 25 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/renderers/opengl_render_target.rb - About 1 hr to fix

                    Method set_from_euler has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def set_from_euler(euler, update = true)
                          # http:#www.mathworks.com/matlabcentral/fileexchange/
                          #   20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/
                          #  content/SpinCalc.m
                          c1 = ::Math.cos(euler.x / 2.0)
                    Severity: Minor
                    Found in lib/mittsu/math/quaternion.rb - About 1 hr to fix

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

                          def initialize(renderer, lights, opengl_objects, opengl_objects_immediate)
                            @renderer, @lights = renderer, lights
                            @opengl_objects = opengl_objects
                            @opengl_objects_immediate = opengl_objects_immediate
                      
                      
                      Severity: Minor
                      Found in lib/mittsu/renderers/opengl/plugins/shadow_map_plugin.rb - About 1 hr to fix

                        Method from_geometry has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def from_geometry(geometry, settings = {})
                              vertices = geometry.vertices
                              faces = geometry.faces
                              face_vertex_uvs = geometry.face_vertex_uvs
                              vertex_colors = settings.fetch(:vertex_colors, Mittsu::NoColors)
                        Severity: Minor
                        Found in lib/mittsu/core/buffer_geometry.rb - About 1 hr to fix

                          Method slerp has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def slerp(qb, t)
                                return self if t.zero?
                                return self.copy(qb) if t == 1.0
                                _x, _y, _z, _w = @x, @y, @z, @w
                                # http:#www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/
                          Severity: Minor
                          Found in lib/mittsu/math/quaternion.rb - About 1 hr to fix

                            Method subdivide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def subdivide(face, detail)
                                  cols = 2.0 ** detail
                                  a = prepare(@vertices[face.a])
                                  b = prepare(@vertices[face.b])
                                  c = prepare(@vertices[face.c])
                            Severity: Minor
                            Found in lib/mittsu/extras/geometries/polyhedron_geometry.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language