ianheggie/cruisecontrol.rb

View on GitHub

Showing 679 of 1,357 total issues

Avoid too many return statements within this function.
Open

                        return ( diff % first === 0 && diff / first >= 0 );
Severity: Major
Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.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-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return ret;
      Severity: Major
      Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

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

          Avoid too many return statements within this function.
          Open

                                      return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
          Severity: Major
          Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return ret === null ?
                            undefined :
                            ret;
            Severity: Major
            Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return;
              Severity: Major
              Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return this;
                Severity: Major
                Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

                    Avoid too many return statements within this function.
                    Open

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

                      Avoid too many return statements within this method.
                      Open

                          render :text => "Build #{params[:build].inspect} not found", :status => 404 and return unless @build
                      Severity: Major
                      Found in app/controllers/builds_controller.rb - About 30 mins to fix

                        Method update_contents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def update_contents
                            @central_contents = File.exist?(@central_config_file) ? File.read(@central_config_file) : nil
                            @config_contents_inside_config_folder = File.exist?(@config_file_inside_config_folder) ? File.read(@config_file_inside_config_folder) : nil
                            @local_contents = File.exist?(@local_config_file) ? File.read(@local_config_file) : nil
                          end
                        Severity: Minor
                        Found in app/models/project_config_tracker.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

                        Method human_time has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def human_time(time)
                            epoch = Time.at(0)
                            today = Time.now.beginning_of_day
                            this_year = today.beginning_of_year
                        
                        
                        Severity: Minor
                        Found in app/helpers/application_helper.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

                        Method serialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def serialize
                            @start_time = Time.now
                            lock = FileLock.new(CruiseControl::Configuration.projects_root.join("build_serialization.lock"))
                            begin
                              lock.lock
                        Severity: Minor
                        Found in lib/build_serializer.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

                        Method to_html has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def to_html( *rules )
                                rules = DEFAULT_RULES if rules.empty?
                                # make our working copy
                                text = self.dup
                                
                        Severity: Minor
                        Found in lib/redcloth.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

                        Method up_to_date? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def up_to_date?(reasons = [], revision_number = last_locally_known_revision.number)
                              result = true
                        
                              latest_revision = self.latest_revision
                              if latest_revision > Revision.new(revision_number)
                        Severity: Minor
                        Found in lib/source_control/subversion.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

                        Method add_release_label has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def add_release_label(to_revision , label)
                            return false if ( to_revision.nil? or label.to_s.strip.empty? )
                            release_label_log = artifact('release_label.log')
                            release_label_log_path = release_label_log.expand_path.to_s
                            begin
                        Severity: Minor
                        Found in app/models/build.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

                        Method show_revisions_in_build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def show_revisions_in_build(revisions)
                            return '' if revisions.empty?
                            if revisions.length == 1
                              revision = revisions[0]
                              text = "<div><span class='build_author'>#{revision.author}</span>" + ' committed the checkin</div>'
                        Severity: Minor
                        Found in app/helpers/projects_helper.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

                        Method build_to_text has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def build_to_text(build, with_elapsed_time = true)
                            text = build_label(build)
                            if build.failed?
                              text += ' FAILED'
                            elsif build.incomplete?
                        Severity: Minor
                        Found in app/helpers/application_helper.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

                        Severity
                        Category
                        Status
                        Source
                        Language