rubinius/rubinius

View on GitHub

Showing 1,541 of 1,541 total issues

File type.rb has 599 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Rubinius
  module Type
    # Performs a direct kind_of? check on the object bypassing any method
    # overrides.
    def self.object_kind_of?(obj, cls)
Severity: Major
Found in core/type.rb - About 1 day to fix

    Method inspect has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
    Open

      def inspect
        result_encoding = Encoding.default_internal || Encoding.default_external
        unless result_encoding.ascii_compatible?
          result_encoding = Encoding::US_ASCII
        end
    Severity: Minor
    Found in core/string.rb - About 1 day 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

    File process.rb has 575 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Process
      def self.time
        Rubinius.primitive :vm_time
        raise PrimitiveFailure, "Process.time primitive failed"
      end
    Severity: Major
    Found in core/process.rb - About 1 day to fix

      File module.rb has 571 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class Module
      
        attr_reader :constant_table
        attr_writer :method_table
      
      
      Severity: Major
      Found in core/module.rb - About 1 day to fix

        Method []= has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
        Open

          def []=(index, count_or_replacement, replacement=undefined)
            if undefined.equal?(replacement)
              replacement = count_or_replacement
              count = nil
            else
        Severity: Minor
        Found in core/string.rb - About 1 day 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

        File pointer_accessors.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Rubinius
        module FFI
          ##
          # This module provides accessors for various different types. It
          # provides methods for:
        Severity: Major
        Found in core/pointer_accessors.rb - About 1 day to fix

          Method constant_scope_defined? has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
          Open

              def self.constant_scope_defined?(scope, name)
                current = scope
          
                until nil.equal? current
                  break if nil.equal? current.parent
          Severity: Minor
          Found in core/type.rb - About 1 day 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

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

            ["A0",0xA0],
            ["A1",0x104],
            ["A2",0x112],
            ["A3",0x122],
            ["A4",0x12A],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0", 0x00A0],
            ["A1", 0x0104],
            ["A2", 0x0105],
            ["A3", 0x0141],
            ["A4", 0x20AC],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0x104],
            ["A2",0x138],
            ["A3",0x156],
            ["A4",0xA4],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0x401],
            ["A2",0x402],
            ["A3",0x403],
            ["A4",0x404],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0x104],
            ["A2",0x2D8],
            ["A3",0x141],
            ["A4",0xA4],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0xA1],
            ["A2",0xA2],
            ["A3",0xA3],
            ["A4",0xA4],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0x1E02],
            ["A2",0x1E03],
            ["A3",0xA3],
            ["A4",0x10A],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0x201D],
            ["A2",0xA2],
            ["A3",0xA3],
            ["A4",0xA4],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0xA1],
            ["A2",0xA2],
            ["A3",0xA3],
            ["A4",0x20AC],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

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

            ["A0",0xA0],
            ["A1",0xA1],
            ["A2",0xA2],
            ["A3",0xA3],
            ["A4",0xA4],
          Severity: Major
          Found in build/libraries/oniguruma/enc/trans/iso-8859-1-tbl.rb and 9 other locations - About 1 day to fix
          build/libraries/oniguruma/enc/trans/iso-8859-10-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-13-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-14-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-15-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-16-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-2-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-4-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-5-tbl.rb on lines 2..97
          build/libraries/oniguruma/enc/trans/iso-8859-9-tbl.rb on lines 2..97

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method validate has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
          Open

            def validate packaging = true
              @warnings = 0
              require 'rubygems/user_interaction'
              extend Gem::UserInteraction
              normalize
          Severity: Minor
          Found in library/rubygems/specification.rb - About 1 day 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 popen has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.popen(*args)
              if env = Rubinius::Type.try_convert(args.first, Hash, :to_hash)
                args.shift
              end
          
          
          Severity: Minor
          Found in core/io.rb - About 1 day 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 options has 222 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def options(argv=ARGV)
                @stage = "processing command line arguments"
          
                options = Options.new "Usage: rbx [subcommand] [options] [--] [script] [arguments]", 25
          
          
          Severity: Major
          Found in core/loader.rb - About 1 day to fix
            Severity
            Category
            Status
            Source
            Language