lib/rdoc/any_method.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

  def marshal_load array
    initialize_visibility

    @dont_rename_initialize = nil
    @token_stream           = nil
Severity: Minor
Found in lib/rdoc/any_method.rb - About 1 hr to fix

    Method deduplicate_call_seq has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      def deduplicate_call_seq(call_seq)
        return call_seq unless is_alias_for || !aliases.empty?
    
        method_name = self.name
        method_name = method_name[0, 1] if method_name =~ /\A\[/
    Severity: Minor
    Found in lib/rdoc/any_method.rb - About 1 hr 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/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 param_list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def param_list
        if @call_seq then
          params = @call_seq.split("\n").last
          params = params.sub(/.*?\((.*)\)/, '\1')
          params = params.sub(/(\{|do)\s*\|([^|]*)\|.*/, ',\2')
    Severity: Minor
    Found in lib/rdoc/any_method.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 is_alias_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def is_alias_for # :nodoc:
        case @is_alias_for
        when RDoc::MethodAttr then
          @is_alias_for
        when Array then
    Severity: Minor
    Found in lib/rdoc/any_method.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 superclass_method has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def superclass_method
        return unless @calls_super
        return @superclass_method if @superclass_method
    
        parent.each_ancestor do |ancestor|
    Severity: Minor
    Found in lib/rdoc/any_method.rb - About 25 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

    There are no issues that match your filters.

    Category
    Status