Showing 372 of 392 total issues

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 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 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 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 get_squashed_tk has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def get_squashed_tk
                  if @buf.empty?
                    tk = @tokens.shift
                  else
                    tk = @buf.shift
              Severity: Minor
              Found in lib/rdoc/parser/ripper_state_lex.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 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

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

                      def parse_symbol_arg_space no, tk # :nodoc:
                        args = []
                    
                        unget_tk tk
                        if tk = parse_symbol_in_arg
                    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 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 build_paragraph has a Cognitive Complexity of 15 (exceeds 5 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/markup/parser.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 47 lines of code (exceeds 25 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

                      Method parse_constant_body has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def parse_constant_body container, constant, is_array_or_hash # :nodoc:
                          nest     = 0
                          rhs_name = ''.dup
                      
                          get_tkread
                      Severity: Minor
                      Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

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

                          Method read_file has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.read_file filename, encoding, force_transcode = false
                              content = File.open filename, "rb" do |f| f.read end
                              content.gsub!("\r\n", "\n") if RUBY_PLATFORM =~ /mswin|mingw/
                          
                              utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
                          Severity: Minor
                          Found in lib/rdoc/encoding.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language