Showing 387 of 405 total issues

Method gen_const_table has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def gen_const_table file_content
    table = {}
    @content.scan(%r{
      (?<doc>(?>^\s*/\*.*?\*/\s+))
        rb_define_(?<type>\w+)\(\s*(?:\w+),\s*
Severity: Minor
Found in lib/rdoc/parser/c.rb - About 1 hr to fix

    Method parse_meta_method has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def parse_meta_method(container, single, tk, comment)
        column  = tk[:char_no]
        line_no = tk[:line_no]
    
        start_collecting_tokens
    Severity: Minor
    Found in lib/rdoc/parser/ruby.rb - About 1 hr to fix

      Method build_paragraph has 26 lines of code (exceeds 25 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/tom_doc.rb - About 1 hr to fix

        Method link has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def link name, text, code = true
            if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])?@/
              name = $1
              label = $'
            end
        Severity: Minor
        Found in lib/rdoc/markup/to_html_crossref.rb - About 1 hr to fix

          Method interactive has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def interactive
              puts "\nEnter the method name you want to look up."
          
              begin
                require 'readline'
          Severity: Minor
          Found in lib/rdoc/ri/driver.rb - About 1 hr to fix

            Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def handle text, code_object = nil, &block
                first_line = 1
                if RDoc::Comment === text then
                  comment = text
                  text = text.text
            Severity: Minor
            Found in lib/rdoc/markup/pre_process.rb - About 1 hr to fix

              Method find_methods has 26 lines of code (exceeds 25 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 1 hr to fix

                Method merge_sections has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def merge_sections cm # :nodoc:
                    my_sections    =    sections.group_by { |section| section.title }
                    other_sections = cm.sections.group_by { |section| section.title }
                
                    other_files = cm.in_files
                Severity: Minor
                Found in lib/rdoc/code_object/class_module.rb - About 55 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 report has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def report
                    if @coverage_level > 0 then
                      extend RDoc::Text
                    end
                
                
                Severity: Minor
                Found in lib/rdoc/stats.rb - About 55 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 param_seq has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def param_seq
                    if @call_seq then
                      params = @call_seq.split("\n").last
                      params = params.sub(/[^( ]+/, '')
                      params = params.sub(/(\|[^|]+\|)\s*\.\.\.\s*(end|\})/, '\1 \2')
                Severity: Minor
                Found in lib/rdoc/code_object/any_method.rb - About 55 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 pretty_print has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def pretty_print q # :nodoc:
                    alias_for =
                      if @is_alias_for.respond_to? :name then
                        "alias for #{@is_alias_for.name}"
                      elsif Array === @is_alias_for then
                Severity: Minor
                Found in lib/rdoc/code_object/method_attr.rb - About 55 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def initialize(base, commit, author, email, date, contents)
                        case contents
                        when String
                          contents = RDoc::Markdown.parse(contents).parts.each do |body|
                            case body
                Severity: Minor
                Found in lib/rdoc/parser/changelog.rb - About 55 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 ancestors_of has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def ancestors_of klass
                    ancestors = []
                
                    unexamined = [klass]
                    seen = []
                Severity: Minor
                Found in lib/rdoc/ri/driver.rb - About 55 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 visit_singleton_class_node has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    def visit_singleton_class_node(node)
                      @scanner.process_comments_until(node.location.start_line - 1)
                
                      expression = node.expression
                      expression = expression.body.body.first if expression.is_a?(Prism::ParenthesesNode) && expression.body&.body&.size == 1
                Severity: Minor
                Found in lib/rdoc/parser/prism_ruby.rb - About 55 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 parse_meta_method_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def parse_meta_method_name comment, tk # :nodoc:
                    if comment.text.sub!(/^# +:?method: *(\S*).*?\n/i, '') then
                      return $1 unless $1.empty?
                    end
                
                
                Severity: Minor
                Found in lib/rdoc/parser/ruby.rb - About 55 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 parse_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def parse_name name
                    parts = name.split(/(::?|#|\.)/)
                
                    if parts.length == 1 then
                      if parts.first =~ /^[a-z]|^([%&*+\/<>^`|~-]|\+@|-@|<<|<=>?|===?|=>|=~|>>|\[\]=?|~@)$/ then
                Severity: Minor
                Found in lib/rdoc/ri/driver.rb - About 55 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 list_known_classes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def list_known_classes names = []
                    classes = []
                
                    stores.each do |store|
                      classes << store.module_names
                Severity: Minor
                Found in lib/rdoc/ri/driver.rb - About 55 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 accept_list_item_start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def accept_list_item_start list_item
                    type = @list_type.last
                
                    case type
                    when :NOTE, :LABEL then
                Severity: Minor
                Found in lib/rdoc/markup/to_rdoc.rb - About 55 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 comment= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def comment=(comment)
                    @comment = case comment
                               when NilClass               then ''
                               when RDoc::Markup::Document then comment
                               when RDoc::Comment          then comment.normalize
                Severity: Minor
                Found in lib/rdoc/code_object.rb - About 55 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_options has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.load_options
                    options_file = File.expand_path '.rdoc_options'
                    return RDoc::Options.new unless File.exist? options_file
                
                    RDoc.load_yaml
                Severity: Minor
                Found in lib/rdoc/options.rb - About 55 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