ianheggie/cruisecontrol.rb

View on GitHub

Showing 679 of 1,357 total issues

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def initialize(number, author = nil, time = nil, message = nil, changeset = nil)
Severity: Minor
Found in lib/source_control/mercurial/revision.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def initialize(number, author = nil, time = nil, message = nil, changeset = nil)
    Severity: Minor
    Found in lib/source_control/bazaar/revision.rb - About 35 mins to fix

      Method request_build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def request_build
          if builder_state_and_activity == 'builder_down'
            BuilderStarter.begin_builder(name)
            10.times do
              sleep 1.second.to_i
      Severity: Minor
      Found in app/models/project.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 do_clean_checkout? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def do_clean_checkout?
          case @clean_checkout_when
          when :always then true
          when nil, :never then false
          else
      Severity: Minor
      Found in app/models/project.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 checkout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def checkout(revision = nil, stdout = $stdout, checkout_path = path)
            raise 'Repository location is not specified' unless @repository
      
            raise "#{checkout_path} is not empty, cannot clone a project into it" unless (Dir.entries(checkout_path) - ['.', '..']).empty?
            FileUtils.rm_rf(checkout_path)
      Severity: Minor
      Found in lib/source_control/git.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 detect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def detect(path)
            git = File.directory?(File.join(path, '.git'))
            svn = File.directory?(File.join(path, '.svn'))
            hg = File.directory?(File.join(path, '.hg'))
            bzr = File.directory?(File.join(path, '.bzr'))
      Severity: Minor
      Found in lib/source_control.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 precise has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def precise
          result = []
          result << "#{@hours} #{hours_label}" unless @hours == 0
          result << "#{@minutes} #{minutes_label}" unless @minutes == 0
          result << "#{@seconds} #{seconds_label}" unless @seconds == 0 and @duration != 0
      Severity: Minor
      Found in lib/duration_formatter.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 start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def start(start_cmd)
        cmd = start_cmd || "cd #{CRUISE_HOME} && ./cruise start -d"
        log(:env, ENV.inspect)
      
        # remove cruise pid file if process is no longer running
      Severity: Minor
      Found in daemon/daemon_helper.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 create_child_process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def create_child_process(project_name, command)
          Bundler.with_clean_env do
            if Kernel.respond_to?(:fork)
              begin
                pid = fork || safely_exec(command)
      Severity: Minor
      Found in lib/platform.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 load_all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def load_all
            plugins_to_load.each do |plugin|
              if can_load_immediately?(plugin)
                load_plugin(File.basename(plugin))
              elsif File.directory?(plugin)
      Severity: Minor
      Found in lib/builder_plugins/builder_plugin.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

      Avoid too many return statements within this function.
      Open

                  return rootjQuery.ready( selector );
      Severity: Major
      Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return jQuery.makeArray( selector, this );
        Severity: Major
        Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return oldSizzle(query, context, extra, seed);
          Severity: Major
          Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return value;
            Severity: Major
            Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                      return true;
              Severity: Major
              Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                        return diff === 0;
                Severity: Major
                Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return false;
                  Severity: Major
                  Found in public/javascripts/jquery_ujs.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return { top: top, left: left };
                    Severity: Major
                    Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return this.css( type, typeof size === "string" ? size : size + "px" );
                      Severity: Major
                      Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return makeArray( context.querySelectorAll(query), extra );
                        Severity: Major
                        Found in public/javascripts/jquery-1.6.1.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language