Showing 372 of 392 total issues

Method handle_directive has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def handle_directive prefix, directive, param, code_object = nil,
                       encoding = nil
    blankline = "#{prefix.strip}\n"
    directive = directive.downcase

Severity: Major
Found in lib/rdoc/markup/pre_process.rb - About 2 hrs to fix

    Class CodeObject has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class RDoc::CodeObject
    
      include RDoc::Text
    
      ##
    Severity: Minor
    Found in lib/rdoc/code_object.rb - About 2 hrs to fix

      Method get_included_module_with_optional_parens has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def get_included_module_with_optional_parens
          skip_tkspace_without_nl
          get_tkread
          tk = get_tk
          end_token = get_end_token tk
      Severity: Major
      Found in lib/rdoc/parser/ruby.rb - About 2 hrs to fix

        Method add_attribute has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def add_attribute attribute
            return attribute unless @document_self
        
            # mainly to check for redefinition of an attribute as a method
            # TODO find a policy for 'attr_reader :foo' + 'def foo=()'
        Severity: Minor
        Found in lib/rdoc/context.rb - About 2 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 process_args has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.process_args argv
            options = default_options
        
            opts = OptionParser.new do |opt|
              opt.program_name = File.basename $0
        Severity: Minor
        Found in lib/rdoc/ri/driver.rb - About 2 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 tokenize has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def tokenize input
            setup_scanner input
        
            until @s.eos? do
              pos = @s.pos
        Severity: Minor
        Found in lib/rdoc/markup/parser.rb - About 2 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 handle has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def handle text, code_object = nil, &block
            if RDoc::Comment === text then
              comment = text
              text = text.text
            end
        Severity: Minor
        Found in lib/rdoc/markup/pre_process.rb - About 2 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 build_verbatim has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def build_verbatim margin
            p :verbatim_begin => margin if @debug
            verbatim = RDoc::Markup::Verbatim.new
        
            min_indent = nil
        Severity: Major
        Found in lib/rdoc/markup/parser.rb - About 2 hrs to fix

          Class Options has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class RDoc::Options
          
            ##
            # The deprecated options.
          
          
          Severity: Minor
          Found in lib/rdoc/options.rb - About 2 hrs to fix

            Method marshal_load has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def marshal_load array # :nodoc:
                initialize_visibility
                initialize_methods_etc
                @current_section   = nil
                @document_self     = true
            Severity: Major
            Found in lib/rdoc/class_module.rb - About 2 hrs to fix

              Method find_symbol_module has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                def find_symbol_module(symbol)
                  result = nil
              
                  # look for a class or module 'symbol'
                  case symbol
              Severity: Minor
              Found in lib/rdoc/context.rb - About 2 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 collect_first_comment has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                def collect_first_comment
                  skip_tkspace
                  comment = ''.dup
                  comment = RDoc::Encoding.change_encoding comment, @encoding if @encoding
                  first_line = true
              Severity: Minor
              Found in lib/rdoc/parser/ruby.rb - About 2 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 find_body has a Cognitive Complexity of 19 (exceeds 5 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: Minor
              Found in lib/rdoc/parser/c.rb - About 2 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 split_into_flow has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                def split_into_flow
                  res = []
                  current_attr = 0
              
                  str_len = @str.length
              Severity: Minor
              Found in lib/rdoc/markup/attribute_manager.rb - About 2 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 build_list has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def build_list margin
                  p :list_start => margin if @debug
              
                  list = RDoc::Markup::List.new
                  label = nil
              Severity: Major
              Found in lib/rdoc/markup/parser.rb - About 2 hrs to fix

                File servlet.rb has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require_relative '../rdoc'
                require 'erb'
                require 'time'
                require 'json'
                
                
                Severity: Minor
                Found in lib/rdoc/servlet.rb - About 2 hrs to fix

                  Class Stats has 23 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class RDoc::Stats
                  
                    include RDoc::Text
                  
                    ##
                  Severity: Minor
                  Found in lib/rdoc/stats.rb - About 2 hrs to fix

                    Method parse_meta_method_params has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def parse_meta_method_params container, single, meth, tk, comment # :nodoc:
                        token_listener meth do
                          meth.params = ''
                    
                          look_for_directives_in meth, comment
                    Severity: Minor
                    Found in lib/rdoc/parser/ruby.rb - About 2 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 marshal_dump has a Cognitive Complexity of 18 (exceeds 5 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/class_module.rb - About 2 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 scan has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def scan
                        reset
                    
                        catch :eof do
                          begin
                    Severity: Minor
                    Found in lib/rdoc/parser/ruby.rb - About 2 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