danini-the-panini/mittsu

View on GitHub
lib/mittsu/extras/geometries/torus_knot_buffer_geometry.rb

Summary

Maintainability
B
4 hrs
Test Coverage
A
100%

Method has too many lines. [59/30]
Open

    def initialize(radius = 100.0, tube = 40.0, radial_segments = 64, tubular_segments = 8, p_val = 2, q_val = 3)
      super()

      @type = 'TorusKnotBufferGeometry'

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method initialize has 59 lines of code (exceeds 25 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: Major
Found in lib/mittsu/extras/geometries/torus_knot_buffer_geometry.rb - About 2 hrs 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 calculate_position_on_curve has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def calculate_position_on_curve(u, p_val, q_val, radius, position)
      Severity: Minor
      Found in lib/mittsu/extras/geometries/torus_knot_buffer_geometry.rb - About 35 mins to fix

        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

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

            def initialize(radius = 100.0, tube = 40.0, radial_segments = 64, tubular_segments = 8, p_val = 2, q_val = 3)

        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.

        There are no issues that match your filters.

        Category
        Status