Showing 388 of 406 total issues

Method merge has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def merge class_module
    @parent      = class_module.parent
    @parent_name = class_module.parent_name

    other_document = parse class_module.comment_location
Severity: Minor
Found in lib/rdoc/code_object/class_module.rb - About 2 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

Method read_directive has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def read_directive allowed
    tokens = []

    while tk = get_tk do
      tokens << tk
Severity: Minor
Found in lib/rdoc/parser/ruby.rb - About 2 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

Method convert_attrs_word_pair_map has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def convert_attrs_word_pair_map(str, attrs, exclusive)
    # then non-matching
    unless @word_pair_map.empty? then
      @word_pair_map.each do |regexp, attr|
        next unless exclusive == exclusive?(attr)
Severity: Minor
Found in lib/rdoc/markup/attribute_manager.rb - About 2 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

Method signature has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def self.signature comment
    return unless comment.tomdoc?

    document = comment.parse

Severity: Minor
Found in lib/rdoc/tom_doc.rb - About 2 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

Method interactive has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def interactive
    puts "\nEnter the method name you want to look up."

    begin
      require 'readline'
Severity: Minor
Found in lib/rdoc/ri/driver.rb - About 2 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

Method merge has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def merge class_module
    @parent      = class_module.parent
    @parent_name = class_module.parent_name

    other_document = parse class_module.comment_location
Severity: Major
Found in lib/rdoc/code_object/class_module.rb - About 2 hrs to fix

    Method find_body has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def find_body class_name, meth_name, meth_obj, file_content, quiet = false
        if file_content
          @body_table ||= {}
          @body_table[file_content] ||= gen_body_table file_content
          type, *args = @body_table[file_content][meth_name]
    Severity: Major
    Found in lib/rdoc/parser/c.rb - About 2 hrs to fix

      File to_html.rb has 253 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'cgi/util'
      
      ##
      # Outputs RDoc markup as HTML.
      
      
      Severity: Minor
      Found in lib/rdoc/markup/to_html.rb - About 2 hrs to fix

        Method parse_method_or_yield_parameters has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def parse_method_or_yield_parameters(method = nil,
                                               modifiers = RDoc::METHOD_MODIFIERS)
            skip_tkspace_without_nl
            tk = get_tk
            end_token = get_end_token tk
        Severity: Major
        Found in lib/rdoc/parser/ruby.rb - About 2 hrs to fix

          Method visit_def_node has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def visit_def_node(node)
                start_line = node.location.start_line
                end_line = node.location.end_line
                @scanner.process_comments_until(start_line - 1)
          
          
          Severity: Major
          Found in lib/rdoc/parser/prism_ruby.rb - About 2 hrs to fix

            Method parse_constant has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def parse_constant container, tk, comment, ignore_constants = false
                line_no = tk[:line_no]
            
                name = tk[:text]
                skip_tkspace_without_nl
            Severity: Minor
            Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

              Method generate_file_files has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def generate_file_files
                  setup
              
                  page_file     = @template_dir + 'page.rhtml'
                  fileinfo_file = @template_dir + 'fileinfo.rhtml'
              Severity: Minor
              Found in lib/rdoc/generator/darkfish.rb - About 1 hr to fix

                Method to_html has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.to_html token_stream
                    starting_title = false
                
                    token_stream.map do |t|
                      next unless t
                Severity: Minor
                Found in lib/rdoc/token_stream.rb - About 1 hr to fix

                  Method handle_method has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def handle_method(type, var_name, meth_name, function, param_count,
                                      source_file = nil)
                      class_name = @known_classes[var_name]
                      singleton  = @singleton_classes.key? var_name
                  
                  
                  Severity: Minor
                  Found in lib/rdoc/parser/c.rb - About 1 hr to fix

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

                      def parse parent, indent = 0
                        p :parse_start => indent if @debug
                    
                        until @tokens.empty? do
                          type, data, column, = get
                    Severity: Minor
                    Found in lib/rdoc/markup/parser.rb - About 1 hr to fix

                      Method document has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def document options
                          self.store = RDoc::Store.new
                      
                          if RDoc::Options === options then
                            @options = options
                      Severity: Minor
                      Found in lib/rdoc/rdoc.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 has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def complete min_visibility
                          fix_basic_object_inheritance
                      
                          # cache included modules before they are removed from the documentation
                          all_classes_and_modules.each { |cm| cm.ancestors }
                      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 save_class has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def save_class klass
                          full_name = klass.full_name
                      
                          FileUtils.mkdir_p class_path(full_name) unless @dry_run
                      
                      
                      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 get_string_tk has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        private def get_string_tk(tk)
                          string = tk[:text]
                          state = nil
                          kind = :on_tstring
                          loop do
                      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 get_class_or_module has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def get_class_or_module container, ignore_constants = false
                          skip_tkspace
                          name_t = get_tk
                          given_name = ''.dup
                      
                      
                      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

                      Severity
                      Category
                      Status
                      Source
                      Language