Showing 372 of 392 total issues

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

  def marshal_load array
    initialize_visibility

    @dont_rename_initialize = nil
    @token_stream           = nil
Severity: Minor
Found in lib/rdoc/any_method.rb - About 1 hr to fix

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

      def split_into_flow
        res = []
        current_attr = 0
    
        str_len = @str.length
    Severity: Minor
    Found in lib/rdoc/markup/attribute_manager.rb - About 1 hr to fix

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

        def define
          desc rdoc_task_description
          task rdoc_task_name
      
          desc rerdoc_task_description
      Severity: Minor
      Found in lib/rdoc/task.rb - About 1 hr to fix

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

          def report_class_module cm
            return if cm.fully_documented? and @coverage_level.zero?
            return unless cm.display?
        
            report = RDoc::Markup::Document.new
        Severity: Minor
        Found in lib/rdoc/stats.rb - About 1 hr to fix

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

            def store_for source_name
              case source_name
              when 'home' then
                RDoc::Store.new RDoc::RI::Paths.home_dir, :home
              when 'ruby' then
          Severity: Minor
          Found in lib/rdoc/servlet.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 parse_method_params_and_body has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def parse_method_params_and_body container, single, meth, added_container
              token_listener meth do
                parse_method_parameters meth
          
                if meth.document_self or not @track_visibility then
          Severity: Minor
          Found in lib/rdoc/parser/ruby.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 print_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def print_file files_so_far, filename
              progress_bar = sprintf("%3d%% [%2d/%2d]  ",
                                     100 * files_so_far / @num_files,
                                     files_so_far,
                                     @num_files)
          Severity: Minor
          Found in lib/rdoc/stats/normal.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 generate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def generate
              return if @spec.default_gem?
              return unless @generate_ri or @generate_rdoc
          
              setup
          Severity: Minor
          Found in lib/rdoc/rubygems_hook.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 report_class_module has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def report_class_module cm
              return if cm.fully_documented? and @coverage_level.zero?
              return unless cm.display?
          
              report = RDoc::Markup::Document.new
          Severity: Minor
          Found in lib/rdoc/stats.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 parse_class_regular has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def parse_class_regular container, declaration_context, single, # :nodoc:
                                    name_t, given_name, comment
              superclass = '::Object'
          
              if given_name =~ /^::/ then
          Severity: Minor
          Found in lib/rdoc/parser/ruby.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 do_classes_and_modules has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def do_classes_and_modules
              do_boot_defclass if @file_name == "class.c"
          
              @content.scan(
                %r(
          Severity: Minor
          Found in lib/rdoc/parser/c.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 load_all has a Cognitive Complexity of 11 (exceeds 5 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

          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 load_variable_map has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def load_variable_map map_name
              return {} unless files = @store.cache[map_name]
              return {} unless name_map = files[@file_name]
          
              class_map = {}
          Severity: Minor
          Found in lib/rdoc/parser/c.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_op_tk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            private def get_op_tk(tk)
              redefinable_operators = %w[! != !~ % & * ** + +@ - -@ / < << <= <=> == === =~ > >= >> [] []= ^ ` | ~]
              if redefinable_operators.include?(tk[:text]) and tk[:state] == EXPR_ARG then
                @inner_lex.lex_state = EXPR_ARG unless RIPPER_HAS_LEX_STATE
                tk[:state] = Ripper::Lexer.const_defined?(:State) ? Ripper::Lexer::State.new(EXPR_ARG) : EXPR_ARG
          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

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

            def complete_klass name, klass, selector, method, completions # :nodoc:
              klasses = classes.keys
          
              # may need to include Foo when given Foo::
              klass_name = method ? name : klass
          Severity: Minor
          Found in lib/rdoc/ri/driver.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 find_c_enclosure has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def find_c_enclosure variable
              @c_enclosure_classes.fetch variable do
                break unless name = @c_enclosure_names[variable]
          
                mod = find_class_or_module name
          Severity: Minor
          Found in lib/rdoc/store.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 setup_pager has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def setup_pager
              return if @use_stdout
          
              pagers = [ENV['RI_PAGER'], ENV['PAGER'], 'pager', 'less', 'more']
          
          
          Severity: Minor
          Found in lib/rdoc/ri/driver.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 parse has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def parse(&block)
              paragraph = ''
              paragraph_start_line = 0
              line_no = 0
          
          
          Severity: Minor
          Found in lib/rdoc/i18n/text.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 skip_optional_do_after_expression has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def skip_optional_do_after_expression
              skip_tkspace_without_nl
              tk = get_tk
          
              b_nest = 0
          Severity: Minor
          Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

            Method collect_first_comment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def collect_first_comment
                skip_tkspace
                comment = ''.dup
                comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
                first_line = true
            Severity: Minor
            Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language