lib/rake/application.rb

Summary

Maintainability
F
4 days
Test Coverage

File application.rb has 702 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "optparse"

require "rake/task_manager"
require "rake/file_list"
require "rake/thread_pool"
Severity: Major
Found in lib/rake/application.rb - About 1 day to fix

    Method standard_rake_options has 215 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def standard_rake_options # :nodoc:
          sort_options(
            [
              ["--all", "-A",
                "Show all tasks, even uncommented ones (in combination with -T or -D)",
    Severity: Major
    Found in lib/rake/application.rb - About 1 day to fix

      Class Application has 55 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Application
          include TaskManager
          include TraceOutput
      
          # The name of the application (typically 'rake')
      Severity: Major
      Found in lib/rake/application.rb - About 7 hrs to fix

        Method standard_rake_options has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def standard_rake_options # :nodoc:
              sort_options(
                [
                  ["--all", "-A",
                    "Show all tasks, even uncommented ones (in combination with -T or -D)",
        Severity: Minor
        Found in lib/rake/application.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 display_tasks_and_comments has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def display_tasks_and_comments # :nodoc:
              displayable_tasks = tasks.select { |t|
                (options.show_all_tasks || t.comment) &&
                  t.name =~ options.show_task_pattern
              }
        Severity: Minor
        Found in lib/rake/application.rb - About 1 hr to fix

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

              def display_tasks_and_comments # :nodoc:
                displayable_tasks = tasks.select { |t|
                  (options.show_all_tasks || t.comment) &&
                    t.name =~ options.show_task_pattern
                }
          Severity: Minor
          Found in lib/rake/application.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 terminal_width has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def terminal_width # :nodoc:
                if @terminal_columns.nonzero?
                  result = @terminal_columns
                else
                  result = unix? ? dynamic_width : 80
          Severity: Minor
          Found in lib/rake/application.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 load_imports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def load_imports # :nodoc:
                while fn = @pending_imports.shift
                  next if @imported.member?(fn)
                  fn_task = lookup(fn) and fn_task.invoke
                  ext = File.extname(fn)
          Severity: Minor
          Found in lib/rake/application.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 raw_load_rakefile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def raw_load_rakefile # :nodoc:
                rakefile, location = find_rakefile_location
                if (!options.ignore_system) &&
                    (options.load_system || rakefile.nil?) &&
                    system_dir && File.directory?(system_dir)
          Severity: Minor
          Found in lib/rake/application.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 have_rakefile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def have_rakefile # :nodoc:
                @rakefiles.each do |fn|
                  if File.exist?(fn)
                    others = FileList.glob(fn, File::FNM_CASEFOLD)
                    return others.size == 1 ? others.first : fn
          Severity: Minor
          Found in lib/rake/application.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