Showing 372 of 392 total issues

Method normalized_file_list has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def normalized_file_list(relative_files, force_doc = false,
                           exclude_pattern = nil)
    file_list = {}

    relative_files.each do |rel_file_name|
Severity: Minor
Found in lib/rdoc/rdoc.rb - About 1 hr to fix

    Method handle_constants has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def handle_constants(type, var_name, const_name, definition)
        class_name = @known_classes[var_name]
    
        return unless class_name
    
    
    Severity: Minor
    Found in lib/rdoc/parser/c.rb - About 1 hr to fix

      Method load_all has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def load_all
          load_cache
      
          module_names.each do |module_name|
            mod = find_class_or_module(module_name) || load_class(module_name)
      Severity: Minor
      Found in lib/rdoc/store.rb - About 1 hr to fix

        Method parse_identifier has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def parse_identifier container, single, tk, comment # :nodoc:
            case tk[:text]
            when 'private', 'protected', 'public', 'private_class_method',
                 'public_class_method', 'module_function' then
              parse_visibility container, single, tk
        Severity: Minor
        Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

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

            def setup_output_dir(dir, force)
              flag_file = output_flag_file dir
          
              last = {}
          
          
          Severity: Minor
          Found in lib/rdoc/rdoc.rb - About 1 hr to fix

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

              def generate_gzipped
                return if @options.dry_run or not defined?(Zlib)
            
                debug_msg "Compressing generated JSON index"
                out_dir = @base_dir + @options.op_dir
            Severity: Minor
            Found in lib/rdoc/generator/json_index.rb - About 1 hr to fix

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

                def calculate
                  return if @doc_items
              
                  ucm = @store.unique_classes_and_modules
              
              
              Severity: Minor
              Found in lib/rdoc/stats.rb - About 1 hr to fix

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

                  def scan
                    reset
                
                    catch :eof do
                      begin
                Severity: Minor
                Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

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

                    def initialize path = nil, type = nil
                      @dry_run  = false
                      @encoding = nil
                      @path     = path
                      @rdoc     = nil
                  Severity: Minor
                  Found in lib/rdoc/store.rb - About 1 hr to fix

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

                      def block_params=(value)
                        # 'yield.to_s' or 'assert yield, msg'
                        return @block_params = '' if value =~ /^[\.,]/
                    
                        # remove trailing 'if/unless ...'
                    Severity: Minor
                    Found in lib/rdoc/method_attr.rb - About 1 hr to fix

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

                        def self.gemdirs filter = :latest
                          ri_paths = {}
                      
                          all = Gem::Specification.map do |spec|
                            [File.join(spec.doc_dir, 'ri'), spec.name, spec.version]
                      Severity: Minor
                      Found in lib/rdoc/ri/paths.rb - About 1 hr to fix

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

                          def parse_method_name_singleton container, name_t # :nodoc:
                            skip_tkspace
                            name_t2 = get_tk
                        
                            if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then
                        Severity: Minor
                        Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

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

                            def get_method_container container, name_t # :nodoc:
                              prev_container = container
                              container = container.find_module_named(name_t[:text])
                          
                              unless container then
                          Severity: Minor
                          Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

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

                              def initialize top_level, file_name, content, options, stats
                                super
                            
                                @known_classes = RDoc::KNOWN_CLASSES.dup
                                @content = handle_tab_width handle_ifdefs_in @content
                            Severity: Minor
                            Found in lib/rdoc/parser/c.rb - About 1 hr to fix

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

                                def update_aliases
                                  constants.each do |const|
                                    next unless cm = const.is_alias_for
                                    cm_alias = cm.dup
                                    cm_alias.name = const.name
                              Severity: Minor
                              Found in lib/rdoc/class_module.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 copy_static has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def copy_static
                                  return if @options.static_path.empty?
                              
                                  fu_options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
                              
                              
                              Severity: Minor
                              Found in lib/rdoc/generator/darkfish.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 add_constant has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def add_constant constant
                                  return constant unless @document_self
                              
                                  # HACK: avoid duplicate 'PI' & 'E' in math.c (1.8.7 source code)
                                  # (this is a #ifdef: should be handled by the C parser)
                              Severity: Minor
                              Found in lib/rdoc/context.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 get_tk has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def get_tk
                                  tk = nil
                              
                                  if @tokens.empty? then
                                    if @scanner_point >= @scanner.size
                              Severity: Minor
                              Found in lib/rdoc/parser/ruby_tools.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 deduplicate_call_seq has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def deduplicate_call_seq(call_seq)
                                  return call_seq unless is_alias_for || !aliases.empty?
                              
                                  method_name = self.name
                                  method_name = method_name[0, 1] if method_name =~ /\A\[/
                              Severity: Minor
                              Found in lib/rdoc/any_method.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 on_kw has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def on_kw(tok, data)
                                    case tok
                                    when 'class'
                                      @lex_state = EXPR_CLASS
                                      @in_fname = true
                              Severity: Minor
                              Found in lib/rdoc/parser/ripper_state_lex.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

                              Severity
                              Category
                              Status
                              Source
                              Language