Showing 43 of 44 total issues

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

      File jamis.rb has 512 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module RDoc
      module Page
      
      FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
      
      
      Severity: Major
      Found in doc/jamis.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

          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

            Class FileList has 29 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class FileList
            
                include Cloneable
            
                # == Method Delegation
            Severity: Minor
            Found in lib/rake/file_list.rb - About 3 hrs to fix

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

                  def define
                    fail "Version required (or :noversion)" if @version.nil?
                    @version = nil if :noversion == @version
              
                    desc "Build all the packages"
              Severity: Minor
              Found in lib/rake/packagetask.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

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

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

                Method start_thread has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                    def start_thread # :nodoc:
                      @threads_mon.synchronize do
                        next unless @threads.count < @max_active_threads
                
                        t = Thread.new do
                Severity: Minor
                Found in lib/rake/thread_pool.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 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 define has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    def define
                      desc @description
                      task @name => Array(deps) do
                        FileUtilsExt.verbose(@verbose) do
                          puts "Use TESTOPTS=\"--verbose\" to pass --verbose" \
                Severity: Minor
                Found in lib/rake/testtask.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 enhance_with_matching_rule has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    def enhance_with_matching_rule(task_name, level=0)
                      fail Rake::RuleRecursionOverflowError,
                        "Rule Recursion Too Deep" if level >= 16
                      @rules.each do |pattern, args, extensions, order_only, block|
                        if pattern && pattern.match(task_name)
                Severity: Minor
                Found in lib/rake/task_manager.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 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

                File file_list.rb has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require "rake/cloneable"
                require "rake/file_utils_ext"
                require "rake/ext/string"
                
                module Rake
                Severity: Minor
                Found in lib/rake/file_list.rb - About 2 hrs to fix

                  Method define has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def define
                        fail "Version required (or :noversion)" if @version.nil?
                        @version = nil if :noversion == @version
                  
                        desc "Build all the packages"
                  Severity: Minor
                  Found in lib/rake/packagetask.rb - About 1 hr to fix

                    Method sh has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def sh(*cmd, &block)
                        options = (Hash === cmd.last) ? cmd.pop : {}
                        shell_runner = block_given? ? block : create_shell_runner(cmd)
                    
                        set_verbose_option(options)
                    Severity: Minor
                    Found in lib/rake/file_utils.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 egrep has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def egrep(pattern, *options)
                          matched = 0
                          each do |fn|
                            begin
                              File.open(fn, "r", *options) do |inf|
                    Severity: Minor
                    Found in lib/rake/file_list.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 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 pathmap has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def pathmap(spec=nil, &block)
                            return self if spec.nil?
                            result = "".dup
                            spec.scan(/%\{[^}]*\}-?\d*[sdpfnxX%]|%-?\d+d|%.|[^%]+/) do |frag|
                              case frag
                      Severity: Minor
                      Found in lib/rake/ext/string.rb - About 1 hr to fix

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language