insideout10/wordlift-plugin-js

View on GitHub
app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js

Summary

Maintainability
F
2 mos
Test Coverage

File jquery.ui.draggable.js has 703 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery UI Draggable 1.10.3
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors
Severity: Major
Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 day to fix

    Function drag has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        drag: function(event, ui) {
    
            var inst = $(this).data("ui-draggable"), that = this;
    
            $.each(inst.sortables, function() {
    Severity: Major
    Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 2 hrs to fix

      Function drag has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          drag: function(event, ui) {
      
              var ts, bs, ls, rs, l, r, t, b, i, first,
                  inst = $(this).data("ui-draggable"),
                  o = inst.options,
      Severity: Major
      Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 2 hrs to fix

        Function _generatePosition has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _generatePosition: function(event) {
        
                var containment, co, top, left,
                    o = this.options,
                    scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
        Severity: Major
        Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 2 hrs to fix

          Function _setContainment has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _setContainment: function() {
          
                  var over, c, ce,
                      o = this.options;
          
          
          Severity: Minor
          Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 hr to fix

            Function _mouseStart has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _mouseStart: function(event) {
            
                    var o = this.options;
            
                    //Create and append the visible helper
            Severity: Minor
            Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 hr to fix

              Function drag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  drag: function( event ) {
              
                      var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
              
                      if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
              Severity: Minor
              Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
                                (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
                            }
                Severity: Major
                Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
                              $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                                  if(that._trigger("stop", event) !== false) {
                                      that._clear();
                                  }
                  Severity: Major
                  Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 1 hr to fix

                    Avoid too many return statements within this function.
                    Open

                                return;
                    Severity: Major
                    Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js - About 30 mins to fix

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

                      (function( $, undefined ) {
                      
                      $.widget("ui.draggable", $.ui.mouse, {
                          version: "1.10.3",
                          widgetEventPrefix: "drag",
                      Severity: Major
                      Found in app/lib/jquery-ui-1.10.3/ui/jquery.ui.draggable.js and 1 other location - About 2 mos to fix
                      app/lib/jquery-ui-1.10.3/ui/jquery-ui.js on lines 985..1927

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

                      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

                      There are no issues that match your filters.

                      Category
                      Status