DamageStudios/rims

View on GitHub

Showing 186 of 250 total issues

Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function done( status, nativeStatusText, responses, headers ) {
            var isSuccess, success, error, response, modified,
                statusText = nativeStatusText;

            // Called once

    Consider simplifying this complex logical expression.
    Open

                            if ( forward && useCache ) {
    
                                // Seek `elem` from a previously-cached index
    
                                // ...in a gzip-friendly way

      Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
          if ( postFilter && !postFilter[ expando ] ) {
              postFilter = setMatcher( postFilter );
          }
          if ( postFinder && !postFinder[ expando ] ) {

        Function send has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        send: function( headers, complete ) {
                            var i,
                                xhr = options.xhr(),
                                id = ++xhrId;
        
        

          Function superMatcher has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  superMatcher = function( seed, context, xml, results, outermost ) {
                      var elem, j, matcher,
                          matchedCount = 0,
                          i = "0",
                          unmatched = seed && [],

            Function init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                init = jQuery.fn.init = function( selector, context, root ) {
                    var match, elem;
            
                    // HANDLE: $(""), $(null), $(undefined), $(false)
                    if ( !selector ) {

              Function domManip has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function domManip( collection, args, callback, ignored ) {
              
                  // Flatten any nested arrays
                  args = concat.apply( [], args );
              
              

                Function handleRemote has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    handleRemote: function(element) {
                      var method, url, data, withCredentials, dataType, options;
                
                      if (rails.fire(element, 'ajax:before')) {
                        withCredentials = element.data('with-credentials') || null;

                  Function Deferred has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Deferred: function( func ) {
                          var tuples = [
                  
                                  // action, add listener, listener list, final state
                                  [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],

                    Function ajaxConvert has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ajaxConvert( s, response, jqXHR, isSuccess ) {
                        var conv2, current, conv, tmp, prev,
                            converters = {},
                    
                            // Work with a copy of dataTypes in case we need to modify it for conversion

                      Function remove has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          remove: function( elem, types, handler, selector, mappedTypes ) {
                              var j, handleObj, tmp,
                                  origCount, t, events,
                                  special, handlers, type,
                                  namespaces, origType,

                        Function show has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Tooltip.prototype.show = function () {
                            var e = $.Event('show.bs.' + this.type)
                        
                            if (this.hasContent() && this.enabled) {
                              this.$element.trigger(e)

                          Function innerSortFunction has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
                          
                                      if (this.className.search(/\bsorttable_sorted\b/) != -1) {
                                        // if we're already sorted by this column, just
                                        // reverse the table, which is quicker

                            Consider simplifying this complex logical expression.
                            Open

                                            if ( ( mappedTypes || origType === handleObj.origType ) &&
                                                ( !handler || handler.guid === handleObj.guid ) &&
                                                ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                                ( !selector || selector === handleObj.selector ||
                                                    selector === "**" && handleObj.selector ) ) {

                              Function innerSortFunction has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                        dean_addEvent(headrow[i],"click", sorttable.innerSortFunction = function(e) {
                              
                                          if (this.className.search(/\bsorttable_sorted\b/) != -1) {
                                            // if we're already sorted by this column, just
                                            // reverse the table, which is quicker
                              Severity: Minor
                              Found in app/assets/javascripts/application.js - About 2 hrs to fix

                                Function slide has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  Carousel.prototype.slide = function (type, next) {
                                    var $active   = this.$element.find('.item.active')
                                    var $next     = next || $active[type]()
                                    var isCycling = this.interval
                                    var direction = type == 'next' ? 'left' : 'right'

                                  Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function internalRemoveData( elem, name, pvt ) {
                                      if ( !acceptData( elem ) ) {
                                          return;
                                      }
                                  
                                  

                                    Function internalData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                                        if ( !acceptData( elem ) ) {
                                            return;
                                        }
                                    
                                    

                                      Function guessType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          guessType: function(table, column) {
                                            // guess the type of a column based on its first non-blank row
                                            sortfn = sorttable.sort_alpha;
                                            for (var i=0; i<table.tBodies[0].rows.length; i++) {
                                              text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);

                                      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 guessType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          guessType: function(table, column) {
                                            // guess the type of a column based on its first non-blank row
                                            sortfn = sorttable.sort_alpha;
                                            for (var i=0; i<table.tBodies[0].rows.length; i++) {
                                              text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
                                      Severity: Minor
                                      Found in app/assets/javascripts/application.js - 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