Showing 388 of 406 total issues

Avoid deeply nested control flow statements.
Open

            if comment_body.size > 1 && comment_body =~ /\n\z/ then
              skip_tkspace_without_nl # leading spaces
            end
Severity: Major
Found in lib/rdoc/parser/ruby.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if container.done_documenting then
                  throw :eof if RDoc::TopLevel === container
                  container.ongoing_visibility = save_visibility
                end
    Severity: Major
    Found in lib/rdoc/parser/ruby.rb - About 45 mins to fix

      Method write_style_sheet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def write_style_sheet
          debug_msg "Copying static files"
          options = { :verbose => $DEBUG_RDOC, :noop => @dry_run }
      
          BUILTIN_STYLE_ITEMS.each do |item|
      Severity: Minor
      Found in lib/rdoc/generator/darkfish.rb - About 45 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

      Avoid deeply nested control flow statements.
      Open

                  line_no = tk[:line_no] if comment.empty?
      Severity: Major
      Found in lib/rdoc/parser/ruby.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

              elsif :on_nl == tk[:kind] then
                if nest <= 0 and RDoc::Parser::RipperStateLex.end?(tk) then
                  unget_tk tk
                  break
                end
        Severity: Major
        Found in lib/rdoc/parser/ruby.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
          Severity: Major
          Found in lib/rdoc/parser/ruby.rb - About 45 mins to fix

            Method parse_meta_attr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def parse_meta_attr(context, single, tk, comment)
                args = parse_symbol_arg
                rw = "?"
            
                # If nodoc is given, don't document any of them
            Severity: Minor
            Found in lib/rdoc/parser/ruby.rb - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def initialize(base, commit, author, email, date, contents)
            Severity: Minor
            Found in lib/rdoc/parser/changelog.rb - About 45 mins to fix

              Method find_class_named_from has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def find_class_named_from name, from
                  from = find_class_named from unless RDoc::Context === from
              
                  until RDoc::TopLevel === from do
                    return nil unless from
              Severity: Minor
              Found in lib/rdoc/store.rb - About 45 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 load_cache has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def load_cache
                  #orig_enc = @encoding
              
                  @cache = marshal_load(cache_path)
              
              
              Severity: Minor
              Found in lib/rdoc/store.rb - About 45 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 handle_method has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def handle_method(type, var_name, meth_name, function, param_count,
                                  source_file = nil)
              Severity: Minor
              Found in lib/rdoc/parser/c.rb - About 45 mins to fix

                Method find_methods has a Cognitive Complexity of 8 (exceeds 5 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 45 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 handle_directive has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def handle_directive prefix, directive, param, code_object = nil,
                                       encoding = nil, line = nil
                Severity: Minor
                Found in lib/rdoc/markup/pre_process.rb - About 45 mins to fix

                  Method display_attributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def display_attributes
                      puts
                      puts @str.tr(NULL, "!")
                      bit = 1
                      16.times do |bno|
                  Severity: Minor
                  Found in lib/rdoc/markup/attribute_manager.rb - About 45 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 convert_regexp_handlings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def convert_regexp_handlings str, attrs, exclusive = false
                      @regexp_handlings.each do |regexp, attribute|
                        next unless exclusive == exclusive?(attribute)
                        str.scan(regexp) do
                          capture = $~.size == 1 ? 0 : 1
                  Severity: Minor
                  Found in lib/rdoc/markup/attribute_manager.rb - About 45 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 finish has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def finish
                      if @write_options then
                        write_options
                        exit
                      end
                  Severity: Minor
                  Found in lib/rdoc/options.rb - About 45 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

                  Avoid deeply nested control flow statements.
                  Open

                              while peek_type == :NEWLINE
                                get
                                peek_type, _, column, = peek_token
                              end
                  Severity: Major
                  Found in lib/rdoc/markup/parser.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if peek_type.nil? || column < margin then
                                  empty = true
                                elsif column == margin then
                                  case peek_type
                                  when type
                    Severity: Major
                    Found in lib/rdoc/markup/parser.rb - About 45 mins to fix

                      Method tt_sections has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def tt_sections text
                          flow = @am.flow text.dup
                      
                          flow.each do |item|
                            case item
                      Severity: Minor
                      Found in lib/rdoc/markup/to_tt_only.rb - About 45 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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def run
                          if @list_doc_dirs then
                            puts @doc_dirs
                          elsif @list then
                            list_known_classes @names
                      Severity: Minor
                      Found in lib/rdoc/ri/driver.rb - About 45 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