rubinius/rubinius

View on GitHub
core/integer.rb

Summary

Maintainability
F
2 wks
Test Coverage

File integer.rb has 1109 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Integer < Numeric
  def self.===(obj)
    Rubinius.asm do
      int = new_label
      done = new_label
Severity: Major
Found in core/integer.rb - About 2 days to fix

    Class Integer has 54 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Integer < Numeric
      def self.===(obj)
        Rubinius.asm do
          int = new_label
          done = new_label
    Severity: Major
    Found in core/integer.rb - About 7 hrs to fix

      Method round has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

        def round(ndigits=undefined)
          return self if undefined.equal? ndigits
      
          if ndigits.kind_of? Numeric
            if ndigits > Fixnum::MAX or ndigits <= Fixnum::MIN
      Severity: Minor
      Found in core/integer.rb - About 4 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 ** has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def **(o)
          Rubinius.asm do
            int = new_label
            eint = new_label
            flt = new_label
      Severity: Major
      Found in core/integer.rb - About 2 hrs to fix

        Method << has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def <<(other)
            Rubinius.asm do
              shl = new_label
              neg = new_label
              eint = new_label
        Severity: Minor
        Found in core/integer.rb - About 1 hr to fix

          Method >> has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def >>(other)
              Rubinius.asm do
                shr = new_label
                neg = new_label
                eint = new_label
          Severity: Minor
          Found in core/integer.rb - About 1 hr to fix

            Method bit_length has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def bit_length
                Rubinius.asm do
                  eint = new_label
                  bits = new_label
                  val = new_label
            Severity: Minor
            Found in core/integer.rb - About 1 hr to fix

              Method <=> has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def <=>(other)
                  Rubinius.asm do
                    int = new_label
                    val = new_label
                    done = new_label
              Severity: Minor
              Found in core/integer.rb - About 1 hr to fix

                Method divmod has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def divmod(other)
                    Rubinius.asm do
                      int = new_label
                      flt = new_label
                      val = new_label
                Severity: Minor
                Found in core/integer.rb - About 1 hr to fix

                  Method <= has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def <=(other)
                      Rubinius.asm do
                        cmp = new_label
                        flt = new_label
                        val = new_label
                  Severity: Minor
                  Found in core/integer.rb - About 1 hr to fix

                    Method >= has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def >=(other)
                        Rubinius.asm do
                          cmp = new_label
                          flt = new_label
                          val = new_label
                    Severity: Minor
                    Found in core/integer.rb - About 1 hr to fix

                      Method > has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def >(other)
                          Rubinius.asm do
                            cmp = new_label
                            flt = new_label
                            val = new_label
                      Severity: Minor
                      Found in core/integer.rb - About 1 hr to fix

                        Method < has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def <(other)
                            Rubinius.asm do
                              cmp = new_label
                              flt = new_label
                              val = new_label
                        Severity: Minor
                        Found in core/integer.rb - About 1 hr to fix

                          Method != has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def !=(other)
                              Rubinius.asm do
                                cmp = new_label
                                flt = new_label
                                val = new_label
                          Severity: Minor
                          Found in core/integer.rb - About 1 hr to fix

                            Method + has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def +(other)
                                Rubinius.asm do
                                  int = new_label
                                  flt = new_label
                                  val = new_label
                            Severity: Minor
                            Found in core/integer.rb - About 1 hr to fix

                              Method * has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def *(other)
                                  Rubinius.asm do
                                    int = new_label
                                    flt = new_label
                                    val = new_label
                              Severity: Minor
                              Found in core/integer.rb - About 1 hr to fix

                                Method / has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def /(other)
                                    Rubinius.asm do
                                      int = new_label
                                      flt = new_label
                                      val = new_label
                                Severity: Minor
                                Found in core/integer.rb - About 1 hr to fix

                                  Method == has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def ==(other)
                                      Rubinius.asm do
                                        cmp = new_label
                                        flt = new_label
                                        val = new_label
                                  Severity: Minor
                                  Found in core/integer.rb - About 1 hr to fix

                                    Method - has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def -(other)
                                        Rubinius.asm do
                                          int = new_label
                                          flt = new_label
                                          val = new_label
                                    Severity: Minor
                                    Found in core/integer.rb - About 1 hr to fix

                                      Method % has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def %(other)
                                          Rubinius.asm do
                                            int = new_label
                                            flt = new_label
                                            val = new_label
                                      Severity: Minor
                                      Found in core/integer.rb - About 1 hr to fix

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

                                          def chr(enc=undefined)
                                            if self < 0 || (self & 0xffff_ffff) != self
                                              raise RangeError, "#{self} is outside of the valid character range"
                                            end
                                        
                                        
                                        Severity: Minor
                                        Found in core/integer.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 round has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def round(ndigits=undefined)
                                            return self if undefined.equal? ndigits
                                        
                                            if ndigits.kind_of? Numeric
                                              if ndigits > Fixnum::MAX or ndigits <= Fixnum::MIN
                                        Severity: Minor
                                        Found in core/integer.rb - About 1 hr to fix

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

                                            def ~
                                              Rubinius.asm do
                                                eint = new_label
                                                val = new_label
                                                done = new_label
                                          Severity: Minor
                                          Found in core/integer.rb - About 1 hr to fix

                                            Method | has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                              def |(other)
                                                Rubinius.asm do
                                                  int = new_label
                                                  done = new_label
                                            
                                            
                                            Severity: Minor
                                            Found in core/integer.rb - About 1 hr to fix

                                              Method ^ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                def ^(other)
                                                  Rubinius.asm do
                                                    int = new_label
                                                    done = new_label
                                              
                                              
                                              Severity: Minor
                                              Found in core/integer.rb - About 1 hr to fix

                                                Method & has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  def &(other)
                                                    Rubinius.asm do
                                                      int = new_label
                                                      done = new_label
                                                
                                                
                                                Severity: Minor
                                                Found in core/integer.rb - About 1 hr to fix

                                                  Method to_f has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                    def to_f
                                                      Rubinius.asm do
                                                        eint = new_label
                                                        done = new_label
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in core/integer.rb - About 1 hr to fix

                                                    Method coerce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                      def coerce(other)
                                                        Rubinius.asm do
                                                          val = new_label
                                                          done = new_label
                                                    
                                                    
                                                    Severity: Minor
                                                    Found in core/integer.rb - About 1 hr to fix

                                                      Method size has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                        def size
                                                          Rubinius.asm do
                                                            eint = new_label
                                                            val = new_label
                                                            done = new_label
                                                      Severity: Minor
                                                      Found in core/integer.rb - About 1 hr to fix

                                                        Method to_s has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                          def to_s(base=10)
                                                            Rubinius.asm do
                                                              int = new_label
                                                              eint = new_label
                                                              base = new_label
                                                        Severity: Minor
                                                        Found in core/integer.rb - About 1 hr to fix

                                                          Method -@ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                            def -@
                                                              Rubinius.asm do
                                                                eint = new_label
                                                                val = new_label
                                                                done = new_label
                                                          Severity: Minor
                                                          Found in core/integer.rb - About 1 hr to fix

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

                                                              def <=>(other)
                                                                Rubinius.asm do
                                                                  int = new_label
                                                                  val = new_label
                                                                  done = new_label
                                                            Severity: Minor
                                                            Found in core/integer.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 upto has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                              def upto(val)
                                                                return to_enum(:upto, val) { self <= val ? val - self + 1 : 0 } unless block_given?
                                                            
                                                                i = self
                                                                while i <= val
                                                            Severity: Minor
                                                            Found in core/integer.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 downto has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                              def downto(val)
                                                                return to_enum(:downto, val) { self >= val ? self - val + 1 : 0 } unless block_given?
                                                            
                                                                i = self
                                                                while i >= val
                                                            Severity: Minor
                                                            Found in core/integer.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

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                  return nil
                                                            Severity: Major
                                                            Found in core/integer.rb - About 30 mins to fix

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

                                                                def <<(other)
                                                                  Rubinius.asm do
                                                                    shl = new_label
                                                                    neg = new_label
                                                                    eint = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 3 hrs to fix
                                                              core/integer.rb on lines 1117..1179

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

                                                              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

                                                                def >>(other)
                                                                  Rubinius.asm do
                                                                    shr = new_label
                                                                    neg = new_label
                                                                    eint = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 3 hrs to fix
                                                              core/integer.rb on lines 1052..1114

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

                                                              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

                                                                def >=(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 3 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 668..716
                                                              core/integer.rb on lines 718..766
                                                              core/integer.rb on lines 768..816

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

                                                              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

                                                                def >(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 3 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 668..716
                                                              core/integer.rb on lines 718..766
                                                              core/integer.rb on lines 818..866

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

                                                              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

                                                                def <(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 3 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 718..766
                                                              core/integer.rb on lines 768..816
                                                              core/integer.rb on lines 818..866

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

                                                              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

                                                                def <=(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 3 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 668..716
                                                              core/integer.rb on lines 768..816
                                                              core/integer.rb on lines 818..866

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

                                                              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

                                                                def ==(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 2 hrs to fix
                                                              core/integer.rb on lines 564..611

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

                                                              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

                                                                def !=(other)
                                                                  Rubinius.asm do
                                                                    cmp = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 2 hrs to fix
                                                              core/integer.rb on lines 617..664

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

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

                                                                def +(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 4 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 225..271
                                                              core/integer.rb on lines 274..320
                                                              core/integer.rb on lines 323..369
                                                              core/integer.rb on lines 386..432

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

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

                                                                def %(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 4 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 176..222
                                                              core/integer.rb on lines 225..271
                                                              core/integer.rb on lines 274..320
                                                              core/integer.rb on lines 323..369

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

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

                                                                def *(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 4 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 176..222
                                                              core/integer.rb on lines 225..271
                                                              core/integer.rb on lines 323..369
                                                              core/integer.rb on lines 386..432

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

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

                                                                def -(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 4 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 176..222
                                                              core/integer.rb on lines 274..320
                                                              core/integer.rb on lines 323..369
                                                              core/integer.rb on lines 386..432

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

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

                                                                def /(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    flt = new_label
                                                                    val = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 4 other locations - About 2 hrs to fix
                                                              core/integer.rb on lines 176..222
                                                              core/integer.rb on lines 225..271
                                                              core/integer.rb on lines 274..320
                                                              core/integer.rb on lines 386..432

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

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

                                                                def &(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    done = new_label
                                                              
                                                              
                                                              Severity: Major
                                                              Found in core/integer.rb and 2 other locations - About 1 hr to fix
                                                              core/integer.rb on lines 964..1005
                                                              core/integer.rb on lines 1008..1049

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

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

                                                                def |(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    done = new_label
                                                              
                                                              
                                                              Severity: Major
                                                              Found in core/integer.rb and 2 other locations - About 1 hr to fix
                                                              core/integer.rb on lines 920..961
                                                              core/integer.rb on lines 1008..1049

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

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

                                                                def ^(other)
                                                                  Rubinius.asm do
                                                                    int = new_label
                                                                    done = new_label
                                                              
                                                              
                                                              Severity: Major
                                                              Found in core/integer.rb and 2 other locations - About 1 hr to fix
                                                              core/integer.rb on lines 920..961
                                                              core/integer.rb on lines 964..1005

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

                                                              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

                                                                def size
                                                                  Rubinius.asm do
                                                                    eint = new_label
                                                                    val = new_label
                                                                    done = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 1 hr to fix
                                                              core/integer.rb on lines 76..115

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

                                                              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

                                                                def -@
                                                                  Rubinius.asm do
                                                                    eint = new_label
                                                                    val = new_label
                                                                    done = new_label
                                                              Severity: Major
                                                              Found in core/integer.rb and 1 other location - About 1 hr to fix
                                                              core/integer.rb on lines 1338..1377

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

                                                              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