DamageStudios/rims

View on GitHub

Showing 250 of 250 total issues

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)

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if (/WebKit/i.test(navigator.userAgent)) { // sniff
                var _timer = setInterval(function() {
                  if (/loaded|complete/.test(document.readyState)) {
                    sorttable.init(); // call the onload handler
                  }
      Severity: Major
      Found in app/assets/javascripts/application.js and 1 other location - About 2 hrs to fix
      public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 15022..15028

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 76.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if (/WebKit/i.test(navigator.userAgent)) { // sniff
                var _timer = setInterval(function() {
                  if (/loaded|complete/.test(document.readyState)) {
                    sorttable.init(); // call the onload handler
                  }
      app/assets/javascripts/application.js on lines 380..386

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 76.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

                  Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  select = Sizzle.select = function( selector, context, results, seed ) {
                      var i, tokens, token, type, find,
                          compiled = typeof selector === "function" && selector,
                          match = !seed && tokenize( (selector = compiled.selector || selector) );
                  
                  

                    Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                        var matched, match, tokens, type,
                            soFar, groups, preFilters,
                            cached = tokenCache[ selector + " " ];
                    
                    

                      Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function matcherFromTokens( tokens ) {
                          var checkContext, matcher, j,
                              len = tokens.length,
                              leadingRelative = Expr.relative[ tokens[0].type ],
                              implicitRelative = leadingRelative || Expr.relative[" "],

                        Function val has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            val: function( value ) {
                                var hooks, ret, isFunction,
                                    elem = this[ 0 ];
                        
                                if ( !arguments.length ) {

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          event.pageX = original.clientX +
                                              ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
                                              ( doc && doc.clientLeft || body && body.clientLeft || 0 );
                          public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 5382..5384

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 71.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                          event.pageY = original.clientY +
                                              ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) -
                                              ( doc && doc.clientTop  || body && body.clientTop  || 0 );
                          public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 5379..5381

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 71.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Function getInnerText has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getInnerText: function(node) {
                                // gets the text we want to use for sorting for a cell.
                                // strips leading and trailing whitespace.
                                // this is *not* a generic getInnerText function; it's special to sorttable.
                                // for example, you can override the cell text with a customkey attribute.

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

                              getInnerText: function(node) {
                                // gets the text we want to use for sorting for a cell.
                                // strips leading and trailing whitespace.
                                // this is *not* a generic getInnerText function; it's special to sorttable.
                                // for example, you can override the cell text with a customkey attribute.
                          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