rubinius/rubinius

View on GitHub
core/sprinter.rb

Summary

Maintainability
F
6 days
Test Coverage

File sprinter.rb has 877 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Rubinius
  class Sprinter
    def self.cache
      @cache
    end
Severity: Major
Found in core/sprinter.rb - About 2 days to fix

    Method parse has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def parse
            @arg_count = 0
            @index_mode = nil
    
            atoms = []
    Severity: Major
    Found in core/sprinter.rb - About 3 hrs to fix

      Method push_format_string has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

              def push_format_string
                float_format_code = @format_code
      
                leader = "%#{@flags}"
                if !@width_index && !@prec_index
      Severity: Minor
      Found in core/sprinter.rb - About 3 hrs 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 bytecode has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

              def bytecode
                if fast_common_case?
                  @g.push_self
      
                  push_value
      Severity: Minor
      Found in core/sprinter.rb - About 2 hrs 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 parse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

            def parse
              @arg_count = 0
              @index_mode = nil
      
              atoms = []
      Severity: Minor
      Found in core/sprinter.rb - About 2 hrs 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 bytecode has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def bytecode
                if fast_common_case?
                  @g.push_self
      
                  push_value
      Severity: Major
      Found in core/sprinter.rb - About 2 hrs to fix

        Method bytecode has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def bytecode
                  radix = RADIX[@format_code]
        
                  push_value
        
        
        Severity: Minor
        Found in core/sprinter.rb - About 1 hr to fix

          Method push_format_string has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def push_format_string
                    float_format_code = @format_code
          
                    leader = "%#{@flags}"
                    if !@width_index && !@prec_index
          Severity: Minor
          Found in core/sprinter.rb - About 1 hr to fix

            Method expand_with_width has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                    def expand_with_width
                      if @f_ljust
                        if @f_space || @f_plus
                          @g.send :space_expand_leader_left, 2
                        else
            Severity: Minor
            Found in core/sprinter.rb - About 1 hr 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 digit_expand_precision has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def digit_expand_precision(int, precision)
                  str = int.to_s
            
                  diff = Integer(precision) - str.size
            
            
            Severity: Minor
            Found in core/sprinter.rb - About 1 hr to fix

              Method zero_expand_integer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def zero_expand_integer(int, width)
                    int = Integer(int) unless int.kind_of? Fixnum
              
                    str = int.to_s
                    return str if width <= str.size
              Severity: Minor
              Found in core/sprinter.rb - About 1 hr to fix

                Method bytecode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def bytecode
                          push_value
                          @b.force_type :Float
                
                          format_done = @g.new_label
                Severity: Minor
                Found in core/sprinter.rb - About 1 hr to fix

                  Method digit_expand_precision has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def digit_expand_precision(int, precision)
                        str = int.to_s
                  
                        diff = Integer(precision) - str.size
                  
                  
                  Severity: Minor
                  Found in core/sprinter.rb - About 1 hr 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 push_width has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def push_width(adjust=true)
                            if @width_static
                              raise ArgumentError, "width too big" unless @width_static.class == Fixnum
                              if adjust && @full_leader_size > 0
                                @g.push_int(@width_static - @full_leader_size)
                  Severity: Minor
                  Found in core/sprinter.rb - About 1 hr 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 next_index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def next_index(specified=nil)
                          if specified
                            specified = specified.to_i
                            raise ArgumentError, "invalid positional index" if specified == 0
                  
                  
                  Severity: Minor
                  Found in core/sprinter.rb - About 1 hr 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 zero_expand_integer has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def zero_expand_integer(int, width)
                        int = Integer(int) unless int.kind_of? Fixnum
                  
                        str = int.to_s
                        return str if width <= str.size
                  Severity: Minor
                  Found in core/sprinter.rb - About 55 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 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def initialize(b, g, format_code, flags, name = nil)
                  Severity: Minor
                  Found in core/sprinter.rb - About 35 mins to fix

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

                            def bytecode
                              radix = RADIX[@format_code]
                    
                              push_value
                    
                    
                    Severity: Minor
                    Found in core/sprinter.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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def initialize(b, g, format_code, flags, name = nil)
                              @b, @g = b, g
                              @format_code, @flags = format_code, flags
                              @name = name
                    
                    
                    Severity: Minor
                    Found in core/sprinter.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 push_precision has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def push_precision
                              if @prec_static
                                raise ArgumentError, "precision too big" unless @prec_static.class == Fixnum
                                @g.push_int @prec_static
                    
                    
                    Severity: Minor
                    Found in core/sprinter.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

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

                          case diff
                          when 1
                            "#{str} "
                          when 2
                            "#{str}  "
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 35 mins to fix
                    core/sprinter.rb on lines 222..232

                    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

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

                          case diff
                          when 1
                            "#{str} "
                          when 2
                            "#{str}  "
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 35 mins to fix
                    core/sprinter.rb on lines 128..138

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

                            case diff
                            when 1
                              "0#{str}"
                            when 2
                              "00#{str}"
                    Severity: Minor
                    Found in core/sprinter.rb and 3 other locations - About 25 mins to fix
                    core/sprinter.rb on lines 67..77
                    core/sprinter.rb on lines 99..109
                    core/sprinter.rb on lines 246..256

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

                            case diff
                            when 1
                              "0#{str}"
                            when 2
                              "00#{str}"
                    Severity: Minor
                    Found in core/sprinter.rb and 3 other locations - About 25 mins to fix
                    core/sprinter.rb on lines 99..109
                    core/sprinter.rb on lines 197..207
                    core/sprinter.rb on lines 246..256

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

                          case diff
                          when 1
                            " #{str}"
                          when 2
                            "  #{str}"
                    Severity: Minor
                    Found in core/sprinter.rb and 3 other locations - About 25 mins to fix
                    core/sprinter.rb on lines 67..77
                    core/sprinter.rb on lines 197..207
                    core/sprinter.rb on lines 246..256

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

                          case diff
                          when 1
                            " #{str}"
                          when 2
                            "  #{str}"
                    Severity: Minor
                    Found in core/sprinter.rb and 3 other locations - About 25 mins to fix
                    core/sprinter.rb on lines 67..77
                    core/sprinter.rb on lines 99..109
                    core/sprinter.rb on lines 197..207

                    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

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

                            case diff
                            when 1
                              "-0#{-int}"
                            when 2
                              "-00#{-int}"
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 25 mins to fix
                    core/sprinter.rb on lines 56..64

                    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

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

                            case diff
                            when 1
                              "-0#{-int}"
                            when 2
                              "-00#{-int}"
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 25 mins to fix
                    core/sprinter.rb on lines 185..193

                    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

                              elsif @prec_index
                                @g.push_local @prec_index
                    
                                @b.force_type :Fixnum, :Integer do
                                  # If we had to do a conversion, we check we ended up
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 20 mins to fix
                    core/sprinter.rb on lines 444..461

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

                    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

                              elsif @width_index
                                @g.push_local @width_index
                    
                                @b.force_type :Fixnum, :Integer do
                                  # If we had to do a conversion, we check we ended up
                    Severity: Minor
                    Found in core/sprinter.rb and 1 other location - About 20 mins to fix
                    core/sprinter.rb on lines 479..496

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status