danini-the-panini/mittsu

View on GitHub

Showing 659 of 659 total issues

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

    def render_objects(render_list, camera, lights, fog, override_material)
Severity: Minor
Found in lib/mittsu/renderers/opengl_renderer.rb - About 35 mins to fix

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

        def self.barycoord_from_point(point, a, b, c, target = Mittsu::Vector3.new)
    Severity: Minor
    Found in lib/mittsu/math/triangle.rb - About 35 mins to fix

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

          def self.map_linear(x, a1, a2, b1, b2)
      Severity: Minor
      Found in lib/mittsu/math.rb - About 35 mins to fix

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

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

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

              def set_xyzw(index, x, y, z, w)
          Severity: Minor
          Found in lib/mittsu/core/buffer_attribute.rb - About 35 mins to fix

            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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      @x = ::Math.asin(Math.clamp(m32, -1.0, 1.0))
                      if m32.abs < 0.99999
                        @y = ::Math.atan2(- m31, m33)
                        @z = ::Math.atan2(- m12, m22)
                      else
              Severity: Minor
              Found in lib/mittsu/math/euler.rb and 1 other location - About 35 mins to fix
              lib/mittsu/math/euler.rb on lines 95..101

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                            custom_attribute.array[offset    ] = value.x
                            custom_attribute.array[offset + 1] = value.y
                            custom_attribute.array[offset + 2] = value.z
                            custom_attribute.array[offset + 3] = value.w
              
              
              Severity: Minor
              Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 35 mins to fix
              lib/mittsu/renderers/opengl/core/geometry.rb on lines 247..253

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      @z = ::Math.asin(Math.clamp(m21, -1.0, 1.0))
                      if m21.abs < 0.99999
                        @x = ::Math.atan2(- m23, m22)
                        @y = ::Math.atan2(- m31, m11)
                      else
              Severity: Minor
              Found in lib/mittsu/math/euler.rb and 1 other location - About 35 mins to fix
              lib/mittsu/math/euler.rb on lines 77..83

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              custom_attribute.array[offset]     = value.x
                              custom_attribute.array[offset + 1] = value.y
                              custom_attribute.array[offset + 2] = value.z
                              custom_attribute.array[offset + 3] = value.w
              
              
              Severity: Minor
              Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 35 mins to fix
              lib/mittsu/renderers/opengl/core/geometry.rb on lines 166..172

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      @x = ::Math.asin(- Math.clamp(m23, -1.0, 1.0))
                      if m23.abs < 0.99999
                        @y = ::Math.atan2(m13, m33)
                        @z = ::Math.atan2(m21, m22)
                      else
              Severity: Minor
              Found in lib/mittsu/math/euler.rb and 1 other location - About 35 mins to fix
              lib/mittsu/math/euler.rb on lines 104..110

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      @z = ::Math.asin(- Math.clamp(m12, -1.0, 1.0))
                      if m12.abs < 0.99999
                        @x = ::Math.atan2(m32, m22)
                        @y = ::Math.atan2(m13, m11)
                      else
              Severity: Minor
              Found in lib/mittsu/math/euler.rb and 1 other location - About 35 mins to fix
              lib/mittsu/math/euler.rb on lines 68..74

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 35.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Avoid parameter lists longer than 5 parameters. [8/5]
              Open

                  def initialize(radius_top = 20.0, radius_bottom = 20.0, height = 100.0, radial_segments = 8, height_segments = 1, open_ended = false, theta_start = 0.0, theta_length = (::Math::PI * 2.0))

              This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

              Severity
              Category
              Status
              Source
              Language