ianheggie/cruisecontrol.rb

View on GitHub

Showing 679 of 1,357 total issues

Method latest_successful has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def latest_successful
    render :text => 'Project not specified', :status => 404 and return unless params[:project]

    @project = Project.find(params[:project])
    render :text => "Project #{params[:project].inspect} not found", :status => 404 and return unless @project
Severity: Minor
Found in app/controllers/builds_controller.rb - About 55 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 flush_left has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def flush_left( text )
        indt = 0
        if text =~ /^ /
            while text !~ /^ {#{indt}}\S/
                indt += 1
Severity: Minor
Found in lib/redcloth.rb - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    def checkout(revision = nil, stdout = $stdout, checkout_path = path)
      raise 'Repository location is not specified' unless repository

      arguments = [repository, checkout_path]
      arguments << "--username" << @username if @username
Severity: Minor
Found in lib/source_control/subversion.rb - About 55 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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def create(scm_options)
      raise ArgumentError, "Repository path is required" if scm_options[:repository].blank?
      scm_type = scm_options[:source_control]

      source_control_class = if scm_type.nil?
Severity: Minor
Found in lib/source_control.rb - About 55 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

Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
Severity: Major
Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 50 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ( pos == null ) {
                                eventType.splice( j--, 1 );
                            }
    Severity: Major
    Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
                              if ( item ) {
                                  found = filter( item, match, i, curLoop );
                                  var pass = not ^ !!found;
      
      
      Severity: Major
      Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

        Function access has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            access: function( elems, key, value, exec, fn, pass ) {
        Severity: Minor
        Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if ( !xhrCallbacks ) {
                                          xhrCallbacks = {};
                                          jQuery( window ).unload( xhrOnUnloadAbort );
                                      }
          Severity: Major
          Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if ( name.indexOf( "data-" ) === 0 ) {
                                        name = jQuery.camelCase( name.substring(5) );
            
                                        dataAttr( this[0], name, data[ name ] );
                                    }
            Severity: Major
            Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
                                      conv2 = converters[ tmp[1] + " " + current ];
                                      if ( conv2 ) {
                                          conv1 = converters[ conv1 ];
                                          if ( conv1 === true ) {
              Severity: Major
              Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                Function isOver has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    isOver: function( y, x, top, left, height, width ) {
                Severity: Minor
                Found in public/javascripts/jquery-ui/development-bundle/ui/jquery.ui.core.js - About 45 mins to fix

                  Function dirNodeCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
                  Severity: Minor
                  Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for ( j = tbody.length - 1; j >= 0 ; --j ) {
                                                if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
                                                    tbody[ j ].parentNode.removeChild( tbody[ j ] );
                                                }
                                            }
                    Severity: Major
                    Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if ( display === "inline" ) {
                                                      this.style.display = "inline-block";
                      
                                                  } else {
                                                      this.style.display = "inline";
                      Severity: Major
                      Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if ( !isXML ) {
                                                elem.sizcache = doneName;
                                                elem.sizset = i;
                                            }
                        Severity: Major
                        Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if ( !anyFound ) {
                                                  return [];
                                              }
                          Severity: Major
                          Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ( ret[r] === ret[n] ) {
                                                        ret.splice(n--, 1);
                                                        break;
                                                    }
                            Severity: Major
                            Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if ( xml && xml.documentElement /* #4958 */ ) {
                                                                      responses.xml = xml;
                                                                  }
                              Severity: Major
                              Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix

                                Function ATTR has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        ATTR: function( match, curLoop, inplace, result, not, isXML ) {
                                Severity: Minor
                                Found in public/javascripts/jquery-1.6.1.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language