danini-the-panini/mittsu

View on GitHub

Showing 226 of 659 total issues

Method set_array3 has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def set_array3(array, i3, a, b = a, c = b)
Severity: Minor
Found in lib/mittsu/core/buffer_geometry.rb - About 35 mins to fix

    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/renderers/opengl/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

    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::OpenGLRenderer#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/renderers/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

    Method set_from_euler has a Cognitive Complexity of 7 (exceeds 5 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 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

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

        def set_from_object(object)
          # Computes the world-axis-aligned bounding box of an object (including its children),
          # accounting for both the object's, and childrens', world transforms
          v1 = Mittsu::Vector3.new
          scope = self
    Severity: Minor
    Found in lib/mittsu/math/box3.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

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

        def add(*arguments)
          if arguments.length > 1
            arguments.each do |arg|
              self.add(arg)
            end
    Severity: Minor
    Found in lib/mittsu/core/object_3d.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

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

        def merge_vertices
          vertices_map = {} # Hashmap for looking up vertice by position coordinates (and making sure they are unique)
          unique = []; changes = []
          precision_points = 4 # number of decimal points, eg. 4 for epsilon of 0.0001
          precision = 10 ** precision_points
    Severity: Minor
    Found in lib/mittsu/core/geometry.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

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

        def self.sign(x)
          return Float::NAN unless x.is_a? Numeric
          return Float::NAN if x.to_f.nan?
          return x.to_f if x.zero?
          return (x < 0) ? -1.0 : (x > 0) ? 1.0 : +x
    Severity: Minor
    Found in lib/mittsu/math.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 too many return statements within this method.
    Open

            return self
    Severity: Major
    Found in lib/mittsu/math/color.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return nil if q_dot_n < 0
      Severity: Major
      Found in lib/mittsu/math/ray.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return nil if d_dot_q_x_e2 + d_dot_e1_x_q > d_dot_n
        Severity: Major
        Found in lib/mittsu/math/ray.rb - About 30 mins to fix

          Method check_intersection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_intersection object, raycaster, ray, pA, pB, pC, point
          
                intersect = nil;
                material = object.material;
          
          
          Severity: Minor
          Found in lib/mittsu/objects/mesh.rb - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize(points, segments = 12, phi_start = 0.0, phi_length = (::Math::PI * 2.0))
                super()
          
                @type = 'LatheGeometry'
          
          
          Severity: Minor
          Found in lib/mittsu/extras/geometries/lathe_geometry.rb - About 25 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_buffer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
                type = GL::UNSIGNED_INT # geometry_group.type_array == Uint32Array ? GL::UNSIGNED_INT : GL::UNSIGNED_SHORT
          
                # wireframe
                if material.wireframe
          Severity: Minor
          Found in lib/mittsu/renderers/opengl/objects/mesh.rb - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 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 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 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 25 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 slerp has a Cognitive Complexity of 6 (exceeds 5 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 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize(radius = 100.0, tube = 40.0, radial_segments = 64, tubular_segments = 8, p_val = 2, q_val = 3)
                super()
          
                @type = 'TorusKnotBufferGeometry'
          
          
          Severity: Minor
          Found in lib/mittsu/extras/geometries/torus_knot_buffer_geometry.rb - About 25 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 project_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def project_object(scene, object, shadow_camera)
                if object.visible
                  opengl_objects = @opengl_objects[object.id]
          
                  if opengl_objects && object.cast_shadow && (object.frustum_culled == false || @frustum.intersects_object?(object) == true)
          Severity: Minor
          Found in lib/mittsu/renderers/opengl/plugins/shadow_map_plugin.rb - About 25 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 call_debug_method has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def call_debug_method m, called_from = caller[0], *args
                if m.to_s.start_with?('Uniform')
                  uniform_name = @@current_shader.get_uniform_name(args.first)
                  call = "#{m}('#{uniform_name}',#{args[1..-1].map { |s| s.to_s[0..20] }.join(', ')})"
                else
          Severity: Minor
          Found in lib/mittsu/renderers/opengl/opengl_debug.rb - About 25 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

          Severity
          Category
          Status
          Source
          Language