lib/rake/task.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Task has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Task
    # List of prerequisites for a task.
    attr_reader :prerequisites
    alias prereqs prerequisites

Severity: Minor
Found in lib/rake/task.rb - About 6 hrs to fix

    File task.rb has 283 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative "invocation_exception_mixin"
    
    module Rake
    
      ##
    Severity: Minor
    Found in lib/rake/task.rb - About 2 hrs to fix

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

          def invoke_with_call_chain(task_args, invocation_chain)
            new_chain = Rake::InvocationChain.append(self, invocation_chain)
            @lock.synchronize do
              begin
                if application.options.trace
      Severity: Minor
      Found in lib/rake/task.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def execute(args=nil)
            args ||= EMPTY_TASK_ARGS
            if application.options.dryrun
              application.trace "** Execute (dry run) #{name}"
              return
      Severity: Minor
      Found in lib/rake/task.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 format_trace_flags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def format_trace_flags
            flags = []
            flags << "first_time" unless @already_invoked
            flags << "not_needed" unless needed?
            flags.empty? ? "" : "(" + flags.join(", ") + ")"
      Severity: Minor
      Found in lib/rake/task.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