Showing 406 of 406 total issues

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

            Method complete has 26 lines of code (exceeds 25 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

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

                def parse_meta_method(container, single, tk, comment)
                  column  = tk[:char_no]
                  line_no = tk[:line_no]
              
                  start_collecting_tokens
              Severity: Minor
              Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

                Method interactive has 26 lines of code (exceeds 25 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 1 hr to fix

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

                    def build_paragraph margin
                      p :paragraph_start => margin if @debug
                  
                      paragraph = RDoc::Markup::Paragraph.new
                  
                  
                  Severity: Minor
                  Found in lib/rdoc/tom_doc.rb - About 1 hr to fix

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

                      def link name, text, code = true
                        if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])?@/
                          name = $1
                          label = $'
                        end
                    Severity: Minor
                    Found in lib/rdoc/markup/to_html_crossref.rb - About 1 hr to fix

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

                        def find_methods name
                          klass, selector, method = parse_name name
                      
                          types = method_type selector
                      
                      
                      Severity: Minor
                      Found in lib/rdoc/ri/driver.rb - About 1 hr to fix

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

                          def handle text, code_object = nil, &block
                            first_line = 1
                            if RDoc::Comment === text then
                              comment = text
                              text = text.text
                        Severity: Minor
                        Found in lib/rdoc/markup/pre_process.rb - About 1 hr to fix

                          Method pretty_print has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def pretty_print q # :nodoc:
                              alias_for =
                                if @is_alias_for.respond_to? :name then
                                  "alias for #{@is_alias_for.name}"
                                elsif Array === @is_alias_for then
                          Severity: Minor
                          Found in lib/rdoc/code_object/method_attr.rb - About 55 mins 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 param_seq has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def param_seq
                              if @call_seq then
                                params = @call_seq.split("\n").last
                                params = params.sub(/[^( ]+/, '')
                                params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
                          Severity: Minor
                          Found in lib/rdoc/code_object/any_method.rb - About 55 mins 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def report
                              if @coverage_level > 0 then
                                extend RDoc::Text
                              end
                          
                          
                          Severity: Minor
                          Found in lib/rdoc/stats.rb - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 visit_singleton_class_node has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def visit_singleton_class_node(node)
                                @scanner.process_comments_until(node.location.start_line - 1)
                          
                                expression = node.expression
                                expression = expression.body.body.first if expression.is_a?(Prism::ParenthesesNode) && expression.body&.body&.size == 1
                          Severity: Minor
                          Found in lib/rdoc/parser/prism_ruby.rb - About 55 mins 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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def initialize(base, commit, author, email, date, contents)
                                  case contents
                                  when String
                                    contents = RDoc::Markdown.parse(contents).parts.each do |body|
                                      case body
                          Severity: Minor
                          Found in lib/rdoc/parser/changelog.rb - About 55 mins 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 ancestors_of has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def ancestors_of klass
                              ancestors = []
                          
                              unexamined = [klass]
                              seen = []
                          Severity: Minor
                          Found in lib/rdoc/ri/driver.rb - About 55 mins 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_meta_method_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def parse_meta_method_name comment, tk # :nodoc:
                              if comment.text.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
                                return $1 unless $1.empty?
                              end
                          
                          
                          Severity: Minor
                          Found in lib/rdoc/parser/ruby.rb - About 55 mins 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