phodal/diaonan

View on GitHub

Showing 191 of 191 total issues

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

        if ( jQuery.isFunction( html ) ) {
            return this.each(function(i) {
                jQuery(this).wrapAll( html.call(this, i) );
            });
        }
Severity: Major
Found in app/assets/js/jquery-1.8.2.js and 1 other location - About 1 hr to fix
app/assets/js/jquery-1.8.2.js on lines 5728..5732

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 56.

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 off has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    off: function( types, selector, fn ) {
        var handleObj, type;
        if ( types && types.preventDefault && types.handleObj ) {
            // ( event )  dispatched jQuery.Event
            handleObj = types.handleObj;
Severity: Minor
Found in app/assets/js/jquery-1.8.2.js - About 1 hr to fix

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

        , show: function () {
            var that = this
              , e = $.Event('show')
    
            this.$element.trigger(e)
    Severity: Minor
    Found in app/assets/js/bootstrap/bootstrap-modal.js - About 1 hr to fix

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

            this.timeout = setTimeout(function() {
              if (self.hoverState == 'in') self.show()
            }, self.options.delay.show)
      Severity: Major
      Found in app/assets/js/bootstrap/bootstrap-tooltip.js and 1 other location - About 1 hr to fix
      app/assets/js/bootstrap/bootstrap-tooltip.js on lines 93..95

      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 55.

      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

      Consider simplifying this complex logical expression.
      Open

      if ( jQuery.expr && jQuery.expr.filters ) {
          jQuery.expr.filters.hidden = function( elem ) {
              return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
          };
      
      
      Severity: Major
      Found in app/assets/js/jquery-1.8.2.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                        if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
        
                            event.data = handleObj.data;
                            event.handleObj = handleObj;
        
        
        Severity: Major
        Found in app/assets/js/jquery-1.8.2.js - About 1 hr to fix

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

                this.timeout = setTimeout(function() {
                  if (self.hoverState == 'out') self.hide()
                }, self.options.delay.hide)
          Severity: Major
          Found in app/assets/js/bootstrap/bootstrap-tooltip.js and 1 other location - About 1 hr to fix
          app/assets/js/bootstrap/bootstrap-tooltip.js on lines 81..83

          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 55.

          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

          Consider simplifying this complex logical expression.
          Open

                          if ( unit !== "px" && start ) {
                              // Iteratively approximate from a nonzero starting point
                              // Prefer the current property, because this process will be trivial if it uses the same units
                              // Fallback to end or a simple constant
                              start = jQuery.css( tween.elem, prop, true ) || end || 1;
          Severity: Major
          Found in app/assets/js/jquery-1.8.2.js - About 1 hr to fix

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

                        while ( i-- ) {
                            if ( (elem = matcherOut[i]) ) {
                                seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
                            }
                        }
            Severity: Minor
            Found in app/assets/js/jquery-1.8.2.js and 1 other location - About 55 mins to fix
            app/assets/js/jquery-1.8.2.js on lines 4880..4884

            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 53.

            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

                        while ( i-- ) {
                            if ( (elem = postFilterIn[i]) ) {
                                matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
                            }
                        }
            Severity: Minor
            Found in app/assets/js/jquery-1.8.2.js and 1 other location - About 55 mins to fix
            app/assets/js/jquery-1.8.2.js on lines 4891..4895

            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 53.

            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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
            Severity: Major
            Found in app/assets/js/jquery-1.8.2.js - About 50 mins to fix

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

              performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
              Severity: Major
              Found in app/assets/js/jsonlint.js - About 50 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ( copyIsArray ) {
                                        copyIsArray = false;
                                        clone = src && jQuery.isArray(src) ? src : [];
                
                                    } else {
                Severity: Major
                Found in app/assets/js/jquery-1.8.2.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if ( !status && s.isLocal && !s.crossDomain ) {
                                                          status = responses.text ? 200 : 404;
                                                      // IE - #1450: sometimes returns 1223 when it should be 204
                                                      } else if ( status === 1223 ) {
                                                          status = 204;
                  Severity: Major
                  Found in app/assets/js/jquery-1.8.2.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

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

                      Avoid deeply nested control flow statements.
                      Open

                                              while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
                                                  className = className.replace( " " + removes[ c ] + " " , " " );
                                              }
                      Severity: Major
                      Found in app/assets/js/jquery-1.8.2.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( selMatch[ sel ] === undefined ) {
                                                    selMatch[ sel ] = handleObj.needsContext ?
                                                        jQuery( sel, this ).index( cur ) >= 0 :
                                                        jQuery.find( sel, this, null, [ cur ] ).length;
                                                }
                        Severity: Major
                        Found in app/assets/js/jquery-1.8.2.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if ( elem.sizset ) {
                                                          return elem;
                                                      }
                          Severity: Major
                          Found in app/assets/js/jquery-1.8.2.js - About 45 mins to fix

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

                                    this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
                            Severity: Minor
                            Found in app/assets/js/bootstrap/bootstrap-tooltip.js and 1 other location - About 45 mins to fix
                            app/assets/js/bootstrap/bootstrap-tooltip.js on lines 53..53

                            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 50.

                            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

                            Avoid deeply nested control flow statements.
                            Open

                                            for (p in table[state]) if (this.terminals_[p] && p > 2) {
                                                expected.push("'"+this.terminals_[p]+"'");
                                            }
                            Severity: Major
                            Found in app/assets/js/jsonlint.js - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language