danini-the-panini/mittsu

View on GitHub

Showing 659 of 659 total issues

Method init_geometry_groups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def init_geometry_groups(object)
      material = object.material
      add_buffers = false

      if @groups.nil? || @groups_need_update
Severity: Minor
Found in lib/mittsu/renderers/opengl/core/geometry.rb - About 45 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 make_orthographic has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def make_orthographic(left, right, top, bottom, near, far)
Severity: Minor
Found in lib/mittsu/math/matrix4.rb - About 45 mins to fix

    Method render_buffer has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def render_buffer(camera, lights, fog, material, geometry_group, object)
    Severity: Minor
    Found in lib/mittsu/renderers/opengl_renderer.rb - About 45 mins to fix

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

          def initialize(radius = 100.0, tube = 40.0, radial_segments = 64, tubular_segments = 8, p_val = 2, q_val = 3)
      Severity: Minor
      Found in lib/mittsu/extras/geometries/torus_knot_buffer_geometry.rb - About 45 mins to fix

        Method render_buffer has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
        Severity: Minor
        Found in lib/mittsu/renderers/opengl/objects/line.rb - About 45 mins to fix

          Method render_buffer has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
          Severity: Minor
          Found in lib/mittsu/renderers/opengl/objects/point_cloud.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      elsif custom_attribute[:size] == 4
                        if custom_attribute[:bound_to].nil? || custom_attribute[:bound_to] == :vertices
                          @faces3.each do |chf|
                            face = obj_faces[chf]
            
            
            Severity: Major
            Found in lib/mittsu/renderers/opengl/opengl_geometry_group.rb - About 45 mins to fix

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

                  def initialize(color = nil, intensity = 1.0, distance = 0.0, angle = (::Math::PI / 3.0), exponent = 10.0, decay = 1.0)
              Severity: Minor
              Found in lib/mittsu/lights/spot_light.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                        if m31.abs < 0.99999
                          @x = ::Math.atan2(m32, m33)
                          @z = ::Math.atan2(m21, m11)
                        else
                          @x = 0.0
                Severity: Major
                Found in lib/mittsu/math/euler.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                        elsif order == 'YZX'
                          @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)
                  Severity: Major
                  Found in lib/mittsu/math/euler.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                s1 = (s0 > 0) ? seg_extent : [[-seg_extent, -b1].max, seg_extent].min
                    Severity: Major
                    Found in lib/mittsu/math/ray.rb - About 45 mins to fix

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

                          def initialize(a, b, c, normal = nil, color = nil, material_index = nil)
                      Severity: Minor
                      Found in lib/mittsu/core/face3.rb - About 45 mins to fix

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

                              te[6] = n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[5] = n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[11] = n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[10] = n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[3] = n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[1] = n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[0] = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 362..362
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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 16 locations. Consider refactoring.
                        Open

                              te[13] = n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34
                        Severity: Major
                        Found in lib/mittsu/math/matrix4.rb and 15 other locations - About 40 mins to fix
                        lib/mittsu/math/matrix4.rb on lines 355..355
                        lib/mittsu/math/matrix4.rb on lines 356..356
                        lib/mittsu/math/matrix4.rb on lines 357..357
                        lib/mittsu/math/matrix4.rb on lines 358..358
                        lib/mittsu/math/matrix4.rb on lines 359..359
                        lib/mittsu/math/matrix4.rb on lines 360..360
                        lib/mittsu/math/matrix4.rb on lines 361..361
                        lib/mittsu/math/matrix4.rb on lines 363..363
                        lib/mittsu/math/matrix4.rb on lines 364..364
                        lib/mittsu/math/matrix4.rb on lines 365..365
                        lib/mittsu/math/matrix4.rb on lines 366..366
                        lib/mittsu/math/matrix4.rb on lines 367..367
                        lib/mittsu/math/matrix4.rb on lines 368..368
                        lib/mittsu/math/matrix4.rb on lines 369..369
                        lib/mittsu/math/matrix4.rb on lines 370..370

                        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 38.

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language