lib/rdoc/stats.rb

Summary

Maintainability
D
2 days
Test Coverage

Method report_methods has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  def report_methods cm
    return if cm.method_list.empty?

    report = []

Severity: Minor
Found in lib/rdoc/stats.rb - About 3 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

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

    File stats.rb has 264 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

        def summary
          calculate
      
          num_width = [@num_files, @num_items].max.to_s.length
          undoc_width = [
      Severity: Minor
      Found in lib/rdoc/stats.rb - About 1 hr to fix

        Method report_class_module has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def report_class_module cm
            return if cm.fully_documented? and @coverage_level.zero?
            return unless cm.display?
        
            report = RDoc::Markup::Document.new
        Severity: Minor
        Found in lib/rdoc/stats.rb - About 1 hr to fix

          Method report_class_module has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def report_class_module cm
              return if cm.fully_documented? and @coverage_level.zero?
              return unless cm.display?
          
              report = RDoc::Markup::Document.new
          Severity: Minor
          Found in lib/rdoc/stats.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 calculate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def calculate
              return if @doc_items
          
              ucm = @store.unique_classes_and_modules
          
          
          Severity: Minor
          Found in lib/rdoc/stats.rb - About 1 hr to fix

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

              def report
                if @coverage_level > 0 then
                  extend RDoc::Text
                end
            
            
            Severity: Minor
            Found in lib/rdoc/stats.rb - About 1 hr to fix

              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 report_constants has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def report_constants cm
                  return if cm.constants.empty?
              
                  report = []
              
              
              Severity: Minor
              Found in lib/rdoc/stats.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 report_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def report_attributes cm
                  return if cm.attributes.empty?
              
                  report = []
              
              
              Severity: Minor
              Found in lib/rdoc/stats.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

              There are no issues that match your filters.

              Category
              Status