Showing 406 of 406 total issues

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

    Method parse_entries has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def parse_entries
        @time_cache ||= {}
    
        if /\A((?:.*\n){,3})commit\s/ =~ @content
          class << self; prepend Git; end
    Severity: Minor
    Found in lib/rdoc/parser/changelog.rb - About 1 hr to fix

      Method visit_call_node has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def visit_call_node(node)
            @scanner.process_comments_until(node.location.start_line - 1)
            if node.receiver.nil?
              case node.name
              when :attr
      Severity: Minor
      Found in lib/rdoc/parser/prism_ruby.rb - About 1 hr to fix

        Method handle_class_module has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def handle_class_module(var_name, type, class_name, parent, in_module)
            parent_name = @known_classes[parent] || parent
        
            if in_module then
              enclosure = @classes[in_module] || @store.find_c_enclosure(in_module)
        Severity: Minor
        Found in lib/rdoc/parser/c.rb - About 1 hr to fix

          Method resolve_method has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def resolve_method name
              ref = nil
          
              if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
                type = $2
          Severity: Minor
          Found in lib/rdoc/cross_reference.rb - About 1 hr to fix

            Method find_method_or_attribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def find_method_or_attribute name # :nodoc:
                return nil unless parent.respond_to? :ancestors
            
                searched = parent.ancestors
                kernel = @store.modules_hash['Kernel']
            Severity: Minor
            Found in lib/rdoc/code_object/method_attr.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_words_tk has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              private def get_words_tk(tk)
                string = ''
                start_token = tk[:text]
                start_quote = tk[:text].rstrip[-1]
                line_no = tk[:line_no]
            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 time_delta_string has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def time_delta_string seconds
                return 'less than a minute'          if seconds < 60
                return "#{seconds / 60} minute#{seconds / 60 == 1 ? '' : 's'}" if
                                                        seconds < 3000     # 50 minutes
                return 'about one hour'              if seconds < 5400     # 90 minutes
            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 get_squashed_tk has a Cognitive Complexity of 13 (exceeds 5 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

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

              def module
                return @module if @module
            
                # search the current context
                return @name unless parent
            Severity: Minor
            Found in lib/rdoc/code_object/mixin.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 handle_constants has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def handle_constants(type, var_name, const_name, definition)
                class_name = @known_classes[var_name]
            
                return unless class_name
            
            
            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 find_or_create_module_path has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def find_or_create_module_path(module_name, create_mode)
                root_name, *path, name = module_name.split('::')
                add_module = ->(mod, name, mode) {
                  case mode
                  when :class
            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 display_name has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def display_name name
                if name =~ /\w:(\w|$)/ then
                  display_page name
                  return true
                end
            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 list_methods_matching has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def list_methods_matching name
                found = []
            
                find_methods name do |store, klass, ancestor, types, method|
                  if types == :instance or types == :both then
            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 marshal_dump has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def marshal_dump # :nodoc:
                attrs = attributes.sort.map do |attr|
                  next unless attr.display?
                  [ attr.name, attr.rw,
                    attr.visibility, attr.singleton, attr.file_name,
            Severity: Minor
            Found in lib/rdoc/code_object/class_module.rb - About 1 hr to fix

              Function performSearch has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function performSearch(data, regexps, queries, highlighters, state) {
                  var searchIndex = data.searchIndex;
                  var longSearchIndex = data.longSearchIndex;
                  var info = data.info;
                  var result = [];
              Severity: Minor
              Found in lib/rdoc/generator/template/json_index/js/searcher.js - About 1 hr to fix

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

                  Method do_methods has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def do_methods
                      @content.scan(%r%rb_define_
                                     (
                                        singleton_method |
                                        method           |
                  Severity: Minor
                  Found in lib/rdoc/parser/c.rb - About 1 hr to fix

                    Method do_constants has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def do_constants
                        @content.scan(%r%\Wrb_define_
                                       ( variable          |
                                         readonly_variable |
                                         const             |
                    Severity: Minor
                    Found in lib/rdoc/parser/c.rb - About 1 hr to fix

                      Method prepare_comments has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def prepare_comments(comments)
                          current = []
                          consecutive_comments = [current]
                          @modifier_comments = {}
                          comments.each do |comment|
                      Severity: Minor
                      Found in lib/rdoc/parser/prism_ruby.rb - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language