danini-the-panini/mittsu

View on GitHub

Showing 659 of 659 total issues

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

    def build_plane(u, v, udir, vdir, width, height, depth, material_index)

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.

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

      if /^rgb\((\d+), ?(\d+), ?(\d+)\)$/i =~ style
        self.r = [255.0, $1.to_f].min / 255.0
        self.g = [255.0, $2.to_f].min / 255.0
        self.b = [255.0, $3.to_f].min / 255.0
        return self
Severity: Minor
Found in lib/mittsu/math/color.rb and 1 other location - About 35 mins to fix
lib/mittsu/math/color.rb on lines 76..80

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

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

      if /^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i =~ style
        self.r = [100.0, $1.to_f].min / 100.0
        self.g = [100.0, $2.to_f].min / 100.0
        self.b = [100.0, $3.to_f].min / 100.0
        return self
Severity: Minor
Found in lib/mittsu/math/color.rb and 1 other location - About 35 mins to fix
lib/mittsu/math/color.rb on lines 69..73

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

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

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

            def check_intersection object, raycaster, ray, pA, pB, pC, point
        Severity: Minor
        Found in lib/mittsu/objects/mesh.rb by rubocop

        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.

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

            def initialize(radius = 50.0, width_segments = 8, height_segments = 6, phi_start = 0.0, phi_length = (::Math::PI * 2.0), theta_start = 0.0, theta_length = ::Math::PI)

        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.

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

            def interpolate(p0, p1, p2, p3, t, t2, t3)
        Severity: Minor
        Found in lib/mittsu/math/spline.rb by rubocop

        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.

        Avoid parameter lists longer than 5 parameters. [7/5]
        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)

        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.

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

            def create_texture(where, name, source_file, repeat, offset, wrap, anisotropy)
        Severity: Minor
        Found in lib/mittsu/loaders/loader.rb by rubocop

        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.

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

                        custom_attribute.value.each do |value|
                          custom_attribute.array[offset]     = value.x
                          custom_attribute.array[offset + 1] = value.y
                          custom_attribute.array[offset + 2] = value.z
        
        
        Severity: Minor
        Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 30 mins to fix
        lib/mittsu/renderers/opengl/core/geometry.rb on lines 229..235

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

        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.value.each do |value|
                          custom_attribute.array[offset]     = value.r
                          custom_attribute.array[offset + 1] = value.g
                          custom_attribute.array[offset + 2] = value.b
        
        
        Severity: Minor
        Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 30 mins to fix
        lib/mittsu/renderers/opengl/core/geometry.rb on lines 237..243

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

        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

                      values.each do |value|
                        custom_attribute.array[offset    ] = value.x
                        custom_attribute.array[offset + 1] = value.y
                        custom_attribute.array[offset + 2] = value.z
        
        
        Severity: Minor
        Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 25 mins to fix
        lib/mittsu/renderers/opengl/core/geometry.rb on lines 148..154

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

        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

                      values.each do |value|
                        custom_attribute.array[offset    ] = value.r
                        custom_attribute.array[offset + 1] = value.g
                        custom_attribute.array[offset + 2] = value.b
        
        
        Severity: Minor
        Found in lib/mittsu/renderers/opengl/core/geometry.rb and 1 other location - About 25 mins to fix
        lib/mittsu/renderers/opengl/core/geometry.rb on lines 156..162

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

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

        Severity
        Category
        Status
        Source
        Language