Showing 387 of 405 total issues

File entities.rb has 2127 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RDoc::Markdown::HTML_ENTITIES = {
  "AElig" => [0x000C6],
  "AMP" => [0x00026],
  "Aacute" => [0x000C1],
  "Abreve" => [0x00102],
Severity: Major
Found in lib/rdoc/markdown/entities.rb - About 5 days to fix

    File ruby.rb has 1528 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    if ENV['RDOC_USE_PRISM_PARSER']
      require 'rdoc/parser/prism_ruby'
      RDoc::Parser.const_set(:Ruby, RDoc::Parser::PrismRuby)
      puts "========================================================================="
      puts "RDoc is using the experimental Prism parser to generate the documentation"
    Severity: Major
    Found in lib/rdoc/parser/ruby.rb - About 4 days to fix

      Method parse_statements has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_statements(container, single = NORMAL, current_method = nil,
                             comment = new_comment(''))
          raise 'no' unless RDoc::Comment === comment
          comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
      
      
      Severity: Minor
      Found in lib/rdoc/parser/ruby.rb - About 3 days 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 driver.rb has 963 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'optparse'
      
      require_relative '../../rdoc'
      
      require_relative 'formatter' # For RubyGems backwards compatibility
      Severity: Major
      Found in lib/rdoc/ri/driver.rb - About 2 days to fix

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

          def parse argv
            ignore_invalid = true
        
            argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
        
        
        Severity: Major
        Found in lib/rdoc/options.rb - About 2 days to fix

          File prism_ruby.rb has 826 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'prism'
          require_relative 'ripper_state_lex'
          
          # Unlike lib/rdoc/parser/ruby.rb, this file is not based on rtags and does not contain code from
          #   rtags.rb -
          Severity: Major
          Found in lib/rdoc/parser/prism_ruby.rb - About 1 day to fix

            File options.rb has 798 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'optparse'
            require 'pathname'
            
            ##
            # RDoc::Options handles the parsing and storage of options
            Severity: Major
            Found in lib/rdoc/options.rb - About 1 day to fix

              File c.rb has 734 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'tsort'
              
              ##
              # RDoc::Parser::C attempts to parse C extension files.  It looks for
              # the standard patterns that you find in extensions: +rb_define_class+,
              Severity: Major
              Found in lib/rdoc/parser/c.rb - About 1 day to fix

                File context.rb has 666 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class RDoc::Context < RDoc::CodeObject
                
                  include Comparable
                
                  ##
                Severity: Major
                Found in lib/rdoc/code_object/context.rb - About 1 day to fix

                  Class Context has 78 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class RDoc::Context < RDoc::CodeObject
                  
                    include Comparable
                  
                    ##
                  Severity: Major
                  Found in lib/rdoc/code_object/context.rb - About 1 day to fix

                    Method parse has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def parse argv
                        ignore_invalid = true
                    
                        argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
                    
                    
                    Severity: Minor
                    Found in lib/rdoc/options.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

                    Class Ruby has 73 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class RDoc::Parser::Ruby < RDoc::Parser
                    
                      parse_files_matching(/\.rbw?$/)
                    
                      include RDoc::TokenStream
                    Severity: Major
                    Found in lib/rdoc/parser/ruby.rb - About 1 day to fix

                      Function prototype has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Searcher.prototype = new function() {
                        // search is performed in chunks of 1000 for non-blocking user input
                        var CHUNK_SIZE = 1000;
                        // do not try to find more than 100 results
                        var MAX_RESULTS = 100;
                      Severity: Minor
                      Found in lib/rdoc/generator/template/json_index/js/searcher.js - 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 build_list has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def build_list margin
                          p :list_start => margin if @debug
                      
                          list = RDoc::Markup::List.new
                          label = nil
                      Severity: Minor
                      Found in lib/rdoc/markup/parser.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 get_included_module_with_optional_parens has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def get_included_module_with_optional_parens
                          skip_tkspace_without_nl
                          get_tkread
                          tk = get_tk
                          end_token = get_end_token tk
                      Severity: Minor
                      Found in lib/rdoc/parser/ruby.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

                      Class Driver has 60 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class RDoc::RI::Driver
                      
                        ##
                        # Base Driver error class
                      
                      
                      Severity: Major
                      Found in lib/rdoc/ri/driver.rb - About 1 day to fix

                        Method add_class has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def add_class class_type, given_name, superclass = '::Object'
                            # superclass +nil+ is passed by the C parser in the following cases:
                            # - registering Object in 1.8 (correct)
                            # - registering BasicObject in 1.9 (correct)
                            # - registering RubyVM in 1.9 in iseq.c (incorrect: < Object in vm.c)
                        Severity: Minor
                        Found in lib/rdoc/code_object/context.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

                        Class Store has 58 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class RDoc::Store
                        
                          ##
                          # Errors raised from loading or saving the store
                        
                        
                        Severity: Major
                        Found in lib/rdoc/store.rb - About 1 day to fix

                          File store.rb has 507 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'fileutils'
                          
                          ##
                          # A set of rdoc data for a single project (gem, path, etc.).
                          #
                          Severity: Major
                          Found in lib/rdoc/store.rb - About 1 day to fix

                            Method handle_directive has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def handle_directive prefix, directive, param, code_object = nil,
                                                   encoding = nil, line = nil
                                blankline = "#{prefix.strip}\n"
                                directive = directive.downcase
                            
                            
                            Severity: Minor
                            Found in lib/rdoc/markup/pre_process.rb - About 7 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

                            Severity
                            Category
                            Status
                            Source
                            Language