Showing 388 of 406 total issues

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 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/code_object/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 override has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def override map # :nodoc:
            if map.has_key?('encoding')
              encoding = map['encoding']
              @encoding = encoding ? Encoding.find(encoding) : encoding
            end
        Severity: Minor
        Found in lib/rdoc/options.rb - About 1 hr to fix

          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/code_object/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 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/code_object/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 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/code_object/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 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 add_class has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def add_class out, name, classes
              heading = if classes.all? { |klass| klass.module? } then
                          name
                        else
                          superclass = classes.map do |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 add_method has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def add_method(name, receiver_name:, receiver_fallback_type:, visibility:, singleton:, params:, calls_super:, block_params:, tokens:, start_line:, end_line:)
              receiver = receiver_name ? find_or_create_module_path(receiver_name, receiver_fallback_type) : @container
              meth = RDoc::AnyMethod.new(nil, name)
              if (comment = consecutive_comment(start_line))
                handle_consecutive_comment_directive(@container, comment)
          Severity: Minor
          Found in lib/rdoc/parser/prism_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 gen_body_table has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def gen_body_table file_content
              table = {}
              file_content.scan(%r{
                ((?>/\*.*?\*/\s*)?)
                ((?:\w+\s+){0,2} VALUE\s+(\w+)
          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 accept_verbatim has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            def accept_verbatim verbatim
              text = verbatim.text.rstrip
          
              klass = nil
          
          
          Severity: Minor
          Found in lib/rdoc/markup/to_html.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 merge_sections has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def merge_sections cm # :nodoc:
              my_sections    =    sections.group_by { |section| section.title }
              other_sections = cm.sections.group_by { |section| section.title }
          
              other_files = cm.in_files
          Severity: Minor
          Found in lib/rdoc/code_object/class_module.rb - About 1 hr to fix

            Method parse_alias has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def parse_alias(context, single, tk, comment)
                line_no = tk[:line_no]
            
                skip_tkspace
            
            
            Severity: Minor
            Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

              Method pretty_print has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def pretty_print q # :nodoc:
                  superclass = @superclass ? " < #{@superclass}" : nil
              
                  q.group 2, "[class #{full_name}#{superclass}", "]" do
                    q.breakable
              Severity: Minor
              Found in lib/rdoc/code_object/normal_class.rb - About 1 hr to fix

                Method report has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def report
                    if @coverage_level > 0 then
                      extend RDoc::Text
                    end
                
                
                Severity: Minor
                Found in lib/rdoc/stats.rb - About 1 hr to fix

                  Method pretty_print has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def pretty_print q # :nodoc:
                      q.group 2, "[module #{full_name}:", "]" do
                        q.breakable
                        q.text "includes:"
                        q.breakable
                  Severity: Minor
                  Found in lib/rdoc/code_object/normal_module.rb - About 1 hr to fix

                    Method add_module_or_class has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def add_module_or_class(module_name, start_line, end_line, is_class: false, superclass_name: nil)
                        comment = consecutive_comment(start_line)
                        handle_consecutive_comment_directive(@container, comment)
                        return unless @container.document_children
                    
                    
                    Severity: Minor
                    Found in lib/rdoc/parser/prism_ruby.rb - About 1 hr to fix

                      Method gen_const_table has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def gen_const_table file_content
                          table = {}
                          @content.scan(%r{
                            (?<doc>(?>^\s*/\*.*?\*/\s+))
                              rb_define_(?<type>\w+)\(\s*(?:\w+),\s*
                      Severity: Minor
                      Found in lib/rdoc/parser/c.rb - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language