mambax7/smartobject

View on GitHub
include/projax_/js/dragdrop.js

Summary

Maintainability
F
2 mos
Test Coverage

File dragdrop.js has 808 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// script.aculo.us dragdrop.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006

// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//           (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
//
Severity: Major
Found in include/projax_/js/dragdrop.js - About 1 day to fix

    Function create has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        create: function (element) {
            element = $(element);
            var options = Object.extend({
                element: element,
                tag: 'li',       // assumes li children, override with tag: 'tagname'
    Severity: Major
    Found in include/projax_/js/dragdrop.js - About 3 hrs to fix

      Function onEmptyHover has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          onEmptyHover: function (element, dropon, overlap) {
              var oldParentNode = element.parentNode;
              var droponOptions = Sortable.options(dropon);
      
              if (!Element.isParent(dropon, element)) {
      Severity: Minor
      Found in include/projax_/js/dragdrop.js - About 2 hrs 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 initialize has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          initialize: function (element) {
              var defaults = {
                  handle: false,
                  reverteffect: function (element, top_offset, left_offset) {
                      var dur = Math.sqrt(Math.abs(top_offset ^ 2) + Math.abs(left_offset ^ 2)) * 0.02;
      Severity: Major
      Found in include/projax_/js/dragdrop.js - About 2 hrs to fix

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

            onHover: function (element, dropon, overlap) {
                if (Element.isParent(dropon, element)) return;
        
                if (overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {
                    return;
        Severity: Minor
        Found in include/projax_/js/dragdrop.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 updateDrag has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            updateDrag: function (event, pointer) {
                if (!this.dragging) this.startDrag(event);
                Position.prepare();
                Droppables.show(pointer, this.element);
                Draggables.notify('onDrag', this, event);
        Severity: Minor
        Found in include/projax_/js/dragdrop.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 draw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            draw: function (point) {
                var pos = Position.cumulativeOffset(this.element);
                if (this.options.ghosting) {
                    var r = Position.realOffset(this.element);
                    window.status = r.inspect();
        Severity: Minor
        Found in include/projax_/js/dragdrop.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 draw has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            draw: function (point) {
                var pos = Position.cumulativeOffset(this.element);
                if (this.options.ghosting) {
                    var r = Position.realOffset(this.element);
                    window.status = r.inspect();
        Severity: Minor
        Found in include/projax_/js/dragdrop.js - About 1 hr to fix

          Function initialize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              initialize: function (element) {
                  var defaults = {
                      handle: false,
                      reverteffect: function (element, top_offset, left_offset) {
                          var dur = Math.sqrt(Math.abs(top_offset ^ 2) + Math.abs(left_offset ^ 2)) * 0.02;
          Severity: Minor
          Found in include/projax_/js/dragdrop.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 updateDrag has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateDrag: function (event, pointer) {
                  if (!this.dragging) this.startDrag(event);
                  Position.prepare();
                  Droppables.show(pointer, this.element);
                  Draggables.notify('onDrag', this, event);
          Severity: Minor
          Found in include/projax_/js/dragdrop.js - About 1 hr to fix

            Function scroll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                scroll: function () {
                    var current = new Date();
                    var delta = current - this.lastScrolled;
                    this.lastScrolled = current;
                    if (this.options.scroll == window) {
            Severity: Minor
            Found in include/projax_/js/dragdrop.js - About 1 hr to fix

              Function scroll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  scroll: function () {
                      var current = new Date();
                      var delta = current - this.lastScrolled;
                      this.lastScrolled = current;
                      if (this.options.scroll == window) {
              Severity: Minor
              Found in include/projax_/js/dragdrop.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

              Consider simplifying this complex logical expression.
              Open

                          if (this.options.scroll == window) {
                              with (this._getWindowScroll(this.options.scroll)) {
                                  p = [left, top, left + width, top + height];
                              }
                          } else {
              Severity: Major
              Found in include/projax_/js/dragdrop.js - About 1 hr to fix

                Function finishDrag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    finishDrag: function (event, success) {
                        this.dragging = false;
                
                        if (this.options.ghosting) {
                            Position.relativize(this.element);
                Severity: Minor
                Found in include/projax_/js/dragdrop.js - About 45 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 _tree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    _tree: function (element, options, parent) {
                        var children = Sortable.findElements(element, options) || [];
                
                        for (var i = 0; i < children.length; ++i) {
                            var match = children[i].id.match(options.format);
                Severity: Minor
                Found in include/projax_/js/dragdrop.js - About 45 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 create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    create: function (element) {
                        element = $(element);
                        var options = Object.extend({
                            element: element,
                            tag: 'li',       // assumes li children, override with tag: 'tagname'
                Severity: Minor
                Found in include/projax_/js/dragdrop.js - About 45 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

                Consider simplifying this complex logical expression.
                Open

                            if (src.tagName && (
                                src.tagName == 'INPUT' ||
                                src.tagName == 'SELECT' ||
                                src.tagName == 'OPTION' ||
                                src.tagName == 'BUTTON' ||
                Severity: Major
                Found in include/projax_/js/dragdrop.js - About 40 mins to fix

                  Function startDrag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      startDrag: function (event) {
                          this.dragging = true;
                  
                          if (this.options.zindex) {
                              this.originalZ = parseInt(Element.getStyle(this.element, 'z-index') || 0);
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 35 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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      add: function (element) {
                          element = $(element);
                          var options = Object.extend({
                              greedy: true,
                              hoverclass: null,
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 35 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 _findChildrenElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _findChildrenElement: function (element, containerTag) {
                          if (element && element.hasChildNodes)
                              for (var i = 0; i < element.childNodes.length; ++i)
                                  if (element.childNodes[i].tagName == containerTag)
                                      return element.childNodes[i];
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 35 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 initDrag has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      initDrag: function (event) {
                          if (typeof Draggable._dragging[this.element] != 'undefined' &&
                              Draggable._dragging[this.element]) return;
                          if (Event.isLeftClick(event)) {
                              // abort on form elements, fixes a Firefox issue
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 25 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 _getWindowScroll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _getWindowScroll: function (w) {
                          var T, L, W, H;
                          with (w.document) {
                              if (w.document.documentElement && documentElement.scrollTop) {
                                  T = documentElement.scrollTop;
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 25 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 mark has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      mark: function (dropon, position) {
                          // mark on ghosting only
                          var sortable = Sortable.options(dropon.parentNode);
                          if (sortable && !sortable.ghosting) return;
                  
                  
                  Severity: Minor
                  Found in include/projax_/js/dragdrop.js - About 25 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

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

                  Draggable.prototype = {
                      initialize: function (element) {
                          var defaults = {
                              handle: false,
                              reverteffect: function (element, top_offset, left_offset) {
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 3 wks to fix
                  include/projax/js/dragdrop.js on lines 242..580
                  include/scriptaculous/src/dragdrop.js on lines 242..580

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

                  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 3 locations. Consider refactoring.
                  Open

                  var Sortable = {
                      SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
                  
                      sortables: {},
                  
                  
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 3 wks to fix
                  include/projax/js/dragdrop.js on lines 603..963
                  include/scriptaculous/src/dragdrop.js on lines 603..963

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

                  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 3 locations. Consider refactoring.
                  Open

                  var Droppables = {
                      drops: [],
                  
                      remove: function (element) {
                          this.drops = this.drops.reject(function (d) {
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 6 days to fix
                  include/projax/js/dragdrop.js on lines 13..132
                  include/scriptaculous/src/dragdrop.js on lines 13..132

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

                  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 3 locations. Consider refactoring.
                  Open

                  var Draggables = {
                      drags: [],
                      observers: [],
                  
                      register: function (draggable) {
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 5 days to fix
                  include/projax/js/dragdrop.js on lines 134..235
                  include/scriptaculous/src/dragdrop.js on lines 134..235

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

                  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 3 locations. Consider refactoring.
                  Open

                  Element.findChildren = function (element, only, recursive, tagName) {
                      if (!element.hasChildNodes()) return null;
                      tagName = tagName.toUpperCase();
                      if (only) only = [only].flatten();
                      var elements = [];
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 1 day to fix
                  include/projax/js/dragdrop.js on lines 974..992
                  include/scriptaculous/src/dragdrop.js on lines 974..992

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

                  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 3 locations. Consider refactoring.
                  Open

                  SortableObserver.prototype = {
                      initialize: function (element, observer) {
                          this.element = $(element);
                          this.observer = observer;
                          this.lastValue = Sortable.serialize(this.element);
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 6 hrs to fix
                  include/projax/js/dragdrop.js on lines 585..601
                  include/scriptaculous/src/dragdrop.js on lines 585..601

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

                  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 3 locations. Consider refactoring.
                  Open

                  Element.isParent = function (child, element) {
                      if (!child.parentNode || child == element) return false;
                  
                      if (child.parentNode == element) return true;
                  
                  
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 1 hr to fix
                  include/projax/js/dragdrop.js on lines 966..972
                  include/scriptaculous/src/dragdrop.js on lines 966..972

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

                  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 3 locations. Consider refactoring.
                  Open

                  Element.offsetSize = function (element, type) {
                      if (type == 'vertical' || type == 'height')
                          return element.offsetHeight;
                      else
                          return element.offsetWidth;
                  Severity: Major
                  Found in include/projax_/js/dragdrop.js and 2 other locations - About 40 mins to fix
                  include/projax/js/dragdrop.js on lines 994..999
                  include/scriptaculous/src/dragdrop.js on lines 994..999

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

                  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