Showing 372 of 392 total issues

File class_module.rb has 476 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class RDoc::ClassModule < RDoc::Context

  ##
  # 1::
  #   RDoc 3.7
Severity: Minor
Found in lib/rdoc/class_module.rb - About 7 hrs to fix

    Method process_args has 184 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.process_args argv
        options = default_options
    
        opts = OptionParser.new do |opt|
          opt.accept File do |file,|
    Severity: Major
    Found in lib/rdoc/ri/driver.rb - About 7 hrs to fix

      Method parse_method_or_yield_parameters has a Cognitive Complexity of 45 (exceeds 5 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: Minor
      Found in lib/rdoc/parser/ruby.rb - About 6 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 parse_constant_body has a Cognitive Complexity of 45 (exceeds 5 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 6 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

      Function prototype has 161 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Searcher.prototype = new function() {
        // search is performed in chunks of 1000 for non-blocking user input
        var CHUNK_SIZE = 1000;
        // do not try to find more than 100 results
        var MAX_RESULTS = 100;
      Severity: Major
      Found in lib/rdoc/generator/template/json_index/js/searcher.js - About 6 hrs to fix

        Method resolve_method has a Cognitive Complexity of 42 (exceeds 5 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 6 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

        File darkfish.rb has 431 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'erb'
        require 'fileutils'
        require 'pathname'
        require_relative 'markup'
        
        
        Severity: Minor
        Found in lib/rdoc/generator/darkfish.rb - About 6 hrs to fix

          Method build_verbatim has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

            def build_verbatim margin
              p :verbatim_begin => margin if @debug
              verbatim = RDoc::Markup::Verbatim.new
          
              min_indent = nil
          Severity: Minor
          Found in lib/rdoc/markup/parser.rb - About 5 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 parse_statements has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def parse_statements(container, single = NORMAL, current_method = nil,
                                 comment = new_comment(''))
              raise 'no' unless RDoc::Comment === comment
              comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
          
          
          Severity: Major
          Found in lib/rdoc/parser/ruby.rb - About 5 hrs to fix

            Method normalized_file_list has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

              def normalized_file_list(relative_files, force_doc = false,
                                       exclude_pattern = nil)
                file_list = {}
            
                relative_files.each do |rel_file_name|
            Severity: Minor
            Found in lib/rdoc/rdoc.rb - About 5 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 generate_file_files has a Cognitive Complexity of 35 (exceeds 5 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 5 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

            Class ClassModule has 38 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class RDoc::ClassModule < RDoc::Context
            
              ##
              # 1::
              #   RDoc 3.7
            Severity: Minor
            Found in lib/rdoc/class_module.rb - About 5 hrs to fix

              File parser.rb has 371 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'strscan'
              
              ##
              # A recursive-descent parser for RDoc markup.
              #
              Severity: Minor
              Found in lib/rdoc/markup/parser.rb - About 4 hrs to fix

                Class InnerStateLex has 35 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class InnerStateLex < Ripper::Filter
                    attr_accessor :lex_state
                
                    def initialize(code)
                      @lex_state = EXPR_BEG
                Severity: Minor
                Found in lib/rdoc/parser/ripper_state_lex.rb - About 4 hrs to fix

                  Method handle_method has a Cognitive Complexity of 30 (exceeds 5 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 4 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

                  Class C has 32 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class RDoc::Parser::C < RDoc::Parser
                  
                    parse_files_matching(/\.(?:([CcHh])\1?|c([+xp])\2|y)\z/)
                  
                    include RDoc::Text
                  Severity: Minor
                  Found in lib/rdoc/parser/c.rb - About 4 hrs to fix

                    Function prototype has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Search.prototype = Object.assign({}, Navigation, new function() {
                      var suid = 1;
                    
                      this.init = function() {
                        var _this = this;
                    Severity: Minor
                    Found in lib/rdoc/generator/template/darkfish/js/search.js - About 3 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 parse_constant has a Cognitive Complexity of 26 (exceeds 5 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 3 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

                    Class ToHtml has 30 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
                    
                      include RDoc::Text
                    
                      # :section: Utilities
                    Severity: Minor
                    Found in lib/rdoc/markup/to_html.rb - About 3 hrs to fix

                      Method to_html has a Cognitive Complexity of 25 (exceeds 5 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 3 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

                      Severity
                      Category
                      Status
                      Source
                      Language