rubinius/rubinius

View on GitHub

Showing 242 of 1,541 total issues

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

    Class Stat has 52 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Stat
        include Comparable
    
        attr_reader :path
    
    
    Severity: Major
    Found in core/stat.rb - About 7 hrs to fix

      Method options has 169 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def options
          @options = Rubinius::Options.new "Usage: configure [options]", 30
          o = @options
          o.left_align
      
      
      Severity: Major
      Found in configure.rb - About 6 hrs to fix

        Method add_install_update_options has 153 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def add_install_update_options
            add_option(:"Install/Update", '-i', '--install-dir DIR',
                       'Gem repository directory to get installed',
                       'gems') do |value, options|
              options[:install_dir] = File.expand_path(value)
        Severity: Major
        Found in library/rubygems/install_update_options.rb - About 6 hrs to fix

          Method validate has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def validate packaging = true
              @warnings = 0
              require 'rubygems/user_interaction'
              extend Gem::UserInteraction
              normalize
          Severity: Major
          Found in library/rubygems/specification.rb - About 5 hrs to fix

            Method inspect has 121 lines of code (exceeds 25 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: Major
            Found in core/string.rb - About 4 hrs to fix

              Method parse_stream has 113 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def parse_stream(f)
                  class_pattern = /class\s+([^\s]+)\s*:\s*public\s+([^\s]+)/
                  slot_pattern = %r!^\s*(\w+)\*?\s+\*?_(\w+)_\s*;\s*//\s*slot(.*)!
                  accessor_pattern = %r!^\s*attr_(accessor|reader|writer)\((\w+),\s*(\w+)\)!
                  primitive_pattern = %r%^\s*//\s+Rubinius.primitive([?!\+])?\s+:(.*)\s*$%
              Severity: Major
              Found in build/scripts/field_extract.rb - About 4 hrs to fix

                Method setup has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def setup
                    super
                
                    @orig_gem_home   = ENV['GEM_HOME']
                    @orig_gem_path   = ENV['GEM_PATH']
                Severity: Major
                Found in library/rubygems/test_case.rb - About 4 hrs to fix

                  Method set_index has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def set_index(index, ent, fin=undefined)
                      Rubinius.primitive :array_aset
                  
                      Rubinius.check_frozen
                  
                  
                  Severity: Major
                  Found in core/array.rb - About 3 hrs to fix

                    Method []= has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def []=(index, count_or_replacement, replacement=undefined)
                        if undefined.equal?(replacement)
                          replacement = count_or_replacement
                          count = nil
                        else
                    Severity: Major
                    Found in core/string.rb - About 3 hrs to fix

                      Method popen has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def self.popen(*args)
                          if env = Rubinius::Type.try_convert(args.first, Hash, :to_hash)
                            args.shift
                          end
                      
                      
                      Severity: Major
                      Found in core/io.rb - About 3 hrs to fix

                        Method initialize has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def initialize(root)
                            @log = Logger.new "configure.log"
                        
                            @command_line = ARGV.dup
                            @log.log "Command line: #{@command_line.join(" ").inspect}"
                        Severity: Major
                        Found in configure.rb - About 3 hrs to fix

                          Method tr_trans has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def tr_trans(source, replacement, squeeze)
                              source = StringValue(source).dup
                              replacement = StringValue(replacement).dup
                          
                              return delete!(source) if replacement.empty?
                          Severity: Major
                          Found in core/string.rb - About 3 hrs to fix

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

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

                              Method run has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def run(factory=ERB)
                                    trim_mode = 0
                                    disable_percent = false
                                    begin
                                      while switch = ARGV.switch
                              Severity: Major
                              Found in library/bin/erb.rb - About 3 hrs to fix

                                Method construct has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def construct(ivar_index = nil, call_proc = true)
                                      type = consume_byte()
                                      obj = case type
                                            when 48   # ?0
                                              nil
                                Severity: Major
                                Found in core/marshal.rb - About 3 hrs to fix

                                  Method split has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def self.split(string, pattern, limit)
                                        # Odd edge case
                                        return [] if string.empty?
                                  
                                        tail_empty = false
                                  Severity: Major
                                  Found in core/splitter.rb - About 3 hrs to fix

                                    Method gsub! has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def gsub!(pattern, replacement=undefined)
                                        # Because of the behavior of $~, this is duplicated from gsub! because
                                        # if we call gsub! from gsub, the last_match can't be updated properly.
                                    
                                        unless valid_encoding?
                                    Severity: Major
                                    Found in core/string.rb - About 2 hrs to fix

                                      Method execute has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def execute
                                          specs = if options[:all] then
                                                    Gem::Specification.map
                                      
                                                  # `--extensions` must be explicitly given to pristine only gems
                                      Severity: Major
                                      Found in library/rubygems/commands/pristine_command.rb - About 2 hrs to fix

                                        Method encode! has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def encode!(to=undefined, from=undefined, options=undefined)
                                            Rubinius.check_frozen
                                        
                                            case to
                                            when Encoding
                                        Severity: Major
                                        Found in core/string.rb - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language