Showing 387 of 405 total issues

Method check_did_you_mean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def check_did_you_mean # :nodoc:
    if defined? DidYouMean::SpellChecker
      true
    else
      begin
Severity: Minor
Found in lib/rdoc/ri/driver.rb - About 35 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 gen_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def gen_url url, text
    if url =~ /^rdoc-label:([^:]*)(?::(.*))?/ then
      type = "link"
    elsif url =~ /([A-Za-z]+):(.*)/ then
      type = $1
Severity: Minor
Found in lib/rdoc/markup/to_html_snippet.rb - About 35 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 gen_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def gen_url url, text
    scheme, url, id = parse_url url

    if %w[http https link].include?(scheme) and
       url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
Severity: Minor
Found in lib/rdoc/markup/to_html.rb - About 35 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 7 (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_markdown.rb - About 35 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 7 (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_bs.rb - About 35 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_method has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def load_method store, cache, klass, type, name
    methods = store.public_send(cache)[klass]

    return unless methods

Severity: Minor
Found in lib/rdoc/ri/driver.rb - About 35 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 << has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def << part
    case part
    when RDoc::Markup::Document then
      unless part.empty? then
        parts.concat part.parts
Severity: Minor
Found in lib/rdoc/markup/document.rb - About 35 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 check_files has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def check_files
    @files.delete_if do |file|
      if File.exist? file then
        if File.readable? file then
          false
Severity: Minor
Found in lib/rdoc/options.rb - About 35 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_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_url url
    case url
    when /^rdoc-label:([^:]*)(?::(.*))?/ then
      scheme = 'link'
      path   = "##{$1}"
Severity: Minor
Found in lib/rdoc/markup/formatter.rb - About 35 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_flow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def convert_flow flow
    throw :done if @characters >= @character_limit

    res = []
    @mask = 0
Severity: Minor
Found in lib/rdoc/markup/to_html_snippet.rb - About 35 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 too many return statements within this method.
Open

    return "#{seconds / 2419200} months" if seconds < 31536000 #  1 year
Severity: Major
Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return "#{seconds / 604800} weeks"   if seconds < 7257600  #  3 months
    Severity: Major
    Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return @module if @module
      Severity: Major
      Found in lib/rdoc/code_object/mixin.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return 'one day'                     if seconds < 86400    #  1 day
        Severity: Major
        Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return @block_params = 'str' if value =~ /^\$[&0-9]$/
          Severity: Major
          Found in lib/rdoc/code_object/method_attr.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return @module if @module
            Severity: Major
            Found in lib/rdoc/code_object/mixin.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return 'about one day'               if seconds < 172800   #  2 days
              Severity: Major
              Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return 'about one week'              if seconds < 1209600  #  2 week
                Severity: Major
                Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return "#{seconds / 86400} days"     if seconds < 604800   #  1 week
                  Severity: Major
                  Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                        return "#{seconds / 31536000} years"
                    Severity: Major
                    Found in lib/rdoc/generator/darkfish.rb - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language