ianheggie/cruisecontrol.rb

View on GitHub

Showing 679 of 1,357 total issues

Method code has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def code
    if CruiseControl::Configuration.disable_code_browsing
      render :text => "Code browsing disabled" and return
    end

Severity: Minor
Found in app/controllers/projects_controller.rb - About 45 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 release_note has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def release_note
    @project = Project.find(params[:id])
    render :text => "Project #{params[:id].inspect} not found", :status => 404 and return unless @project

    @project.generate_release_note(params[:from], params[:to], params[:message], params[:email], params[:release_label] ) rescue nil
Severity: Minor
Found in app/controllers/projects_controller.rb - About 45 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 notify has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def notify(message)
    #connect
    begin
      CruiseControl::Log.debug("Jabber notifier: sending notice: '#{message}'")
      @subscribers.each do |subscriber|
Severity: Minor
Found in lib/builder_plugins/jabber_notifier.rb - About 45 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_report has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def build_report(build, recipients, from, subject, message, sent_at = Time.now)
Severity: Minor
Found in app/models/build_mailer.rb - About 45 mins to fix

    Method send_release_note has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def send_release_note(build, recipients, from, subject, message, sent_at = Time.now)
    Severity: Minor
    Found in app/models/build_mailer.rb - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
                      Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
      
                  ret = Sizzle.find( parts.shift(), context, contextXML );
                  context = ret.expr ?
      Severity: Major
      Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

        if ( !jQuery.support.opacity ) {
            jQuery.cssHooks.opacity = {
                get: function( elem, computed ) {
                    // IE uses filters for opacity
                    return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
        Severity: Major
        Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

          if ( jQuery.expr && jQuery.expr.filters ) {
              jQuery.expr.filters.hidden = function( elem ) {
                  var width = elem.offsetWidth,
                      height = elem.offsetHeight;
          
          
          Severity: Major
          Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
                        return;
                    }
            Severity: Major
            Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if ( s.crossDomain == null ) {
                          parts = rurl.exec( s.url.toLowerCase() );
                          s.crossDomain = !!( parts &&
                              ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
                                  ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
              Severity: Major
              Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
                                    (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
                                    type === "select-multiple" ) {
                                    testChange.call( this, e );
                                }
                Severity: Major
                Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          } else if ( typeof value === "string" && !rnocache.test( value ) &&
                              (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
                              !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
                  
                              value = value.replace(rxhtmlTag, "<$1></$2>");
                  Severity: Major
                  Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
                            return;
                        }
                    Severity: Major
                    Found in public/javascripts/jquery-1.6.1.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if ( ( this.options.values.length === 2 && this.options.range === true ) && 
                                          ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
                                      ) {
                                      newVal = otherVal;
                                  }
                      Severity: Major
                      Found in public/javascripts/jquery-ui/development-bundle/ui/jquery.ui.slider.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
                                        $li.hasClass( "ui-state-disabled" ) ||
                                        $li.hasClass( "ui-state-processing" ) ||
                                        self.panels.filter( ":animated" ).length ||
                                        self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
                        Severity: Major
                        Found in public/javascripts/jquery-ui/development-bundle/ui/jquery.ui.tabs.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if(
                                          inst.options.greedy
                                          && !inst.options.disabled
                                          && inst.options.scope == draggable.options.scope
                                          && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))

                            Consider simplifying this complex logical expression.
                            Open

                                    if (
                                        // ignore null and undefined values
                                        value == null ||
                                        // ignore functions (when does this occur?)
                                        $.isFunction(value) ||

                              Consider simplifying this complex logical expression.
                              Open

                                      if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
                                              // #6694 - don't focus the input if it's already focused
                                              // this breaks the change event in IE
                                              inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
                                          inst.input.focus();

                                Consider simplifying this complex logical expression.
                                Open

                                        if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
                                                // #6694 - don't focus the input if it's already focused
                                                // this breaks the change event in IE
                                                inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
                                            inst.input.focus();

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (
                                              // ignore null and undefined values
                                              value == null ||
                                              // ignore functions (when does this occur?)
                                              $.isFunction(value) ||
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language