mar10/fancytree

View on GitHub

Showing 700 of 700 total issues

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

                Object.defineProperty( event, "pageX", {
                    get: function() {
                        return options.clientX +
                            ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
                            ( doc && doc.clientLeft || body && body.clientLeft || 0 );
Severity: Major
Found in lib/jquery.simulate.js and 1 other location - About 2 hrs to fix
lib/jquery.simulate.js on lines 129..135

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

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

                Object.defineProperty( event, "pageY", {
                    get: function() {
                        return options.clientY +
                            ( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
                            ( doc && doc.clientTop || body && body.clientTop || 0 );
Severity: Major
Found in lib/jquery.simulate.js and 1 other location - About 2 hrs to fix
lib/jquery.simulate.js on lines 122..128

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

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

File jquery.fancytree.glyph.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jquery.fancytree.glyph.js
 *
 * Use glyph-fonts, ligature-fonts, or SVG icons instead of icon sprites.
 * (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
Severity: Minor
Found in src/jquery.fancytree.glyph.js - About 2 hrs to fix

    Function Fancytree has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function Fancytree(widget) {
            this.widget = widget;
            this.$div = widget.element;
            this.options = widget.options;
            if (this.options) {
    Severity: Major
    Found in src/jquery.fancytree.js - About 2 hrs to fix

      Function visitRows has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              visitRows: function (fn, opts) {
                  if (!this.rootNode.hasChildren()) {
                      return false;
                  }
                  if (opts && opts.reverse) {
      Severity: Major
      Found in src/jquery.fancytree.js - About 2 hrs to fix

        Function editEnd has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.ui.fancytree._FancytreeNodeClass.prototype.editEnd = function (
                applyChanges,
                _event
            ) {
                var newVal,
        Severity: Major
        Found in src/jquery.fancytree.edit.js - About 2 hrs to fix

          Function addSampleButton has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              window.addSampleButton = function (options) {
                  var sourceCode,
                      opts = $.extend({}, SAMPLE_BUTTON_DEFAULTS, options),
                      $buttonBar = $("#sampleButtons"),
                      $container = $("<span />", {
          Severity: Major
          Found in demo/sample.js - About 2 hrs to fix

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

                    generateFormElements: function (selected, active, opts) {
                        opts = opts || {};
            
                        var nodeList,
                            selectedName =
            Severity: Major
            Found in src/jquery.fancytree.js - About 2 hrs to fix

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

              function domManip( collection, args, callback, ignored ) {
              
                  // Flatten any nested arrays
                  args = flat( args );
              
              
              Severity: Major
              Found in lib/jquery.js - About 2 hrs to fix

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

                            if (k2 === -d || k2 !== d && v2[k2Offset - 1] < v2[k2Offset + 1]) {
                              x2 = v2[k2Offset + 1];
                            } else {
                              x2 = v2[k2Offset - 1] + 1;
                            }
                Severity: Major
                Found in lib/qunit.js and 1 other location - About 2 hrs to fix
                lib/qunit.js on lines 7224..7228

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

                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

                            if (k1 === -d || k1 !== d && v1[k1Offset - 1] < v1[k1Offset + 1]) {
                              x1 = v1[k1Offset + 1];
                            } else {
                              x1 = v1[k1Offset - 1] + 1;
                            }
                Severity: Major
                Found in lib/qunit.js and 1 other location - About 2 hrs to fix
                lib/qunit.js on lines 7264..7268

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

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

                        applyCommand: function (cmd, node, opts_) {
                            var // clipboard,
                                refNode;
                            // opts = $.extend(
                            //     { setActive: true, clipboard: CLIPBOARD },
                Severity: Major
                Found in src/jquery.fancytree.js - About 2 hrs to fix

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

                          nodeSetExpanded: function (ctx, flag, callOpts) {
                              var node = ctx.node,
                                  tree = ctx.tree;
                  
                              // flag defaults to true
                  Severity: Major
                  Found in src/jquery.fancytree.grid.js - About 2 hrs to fix

                    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
                    Severity: Major
                    Found in lib/jquery.js - About 2 hrs to fix

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

                              nodeSetExpanded: function (ctx, flag, callOpts) {
                                  // flag defaults to true
                                  flag = flag !== false;
                      
                                  if ((ctx.node.expanded && flag) || (!ctx.node.expanded && !flag)) {
                      Severity: Major
                      Found in src/jquery.fancytree.table.js - About 2 hrs to fix

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

                            function _loadLazyNodes(tree, local, keyList, mode, dfd) {
                                var i,
                                    key,
                                    l,
                                    node,
                        Severity: Major
                        Found in src/jquery.fancytree.persist.js - About 2 hrs to fix

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

                              var process = function() {
                                var level       = 0;
                                var levels      = [0,0,0,0,0,0,0];
                                var hLevelText  = '';
                                var prependText = '';
                          Severity: Major
                          Found in lib/jquery.planize.js - About 2 hrs to fix

                            Function _walk has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        function _walk(node) {
                                            var i,
                                                l,
                                                child,
                                                s,
                            Severity: Major
                            Found in src/jquery.fancytree.js - About 2 hrs to fix

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

                                                          } else if( document.body ) {
                                                              d.pageYOffset = document.body.scrollTop;
                                                              d.pageXOffset = document.body.scrollLeft;
                                                              d.innerHeight = document.body.clientHeight;
                                                              d.innerWidth = document.body.clientWidth;
                              Severity: Major
                              Found in lib/contextmenu-abs/jquery.contextMenu-custom.js and 1 other location - About 2 hrs to fix
                              lib/contextmenu-abs/jquery.contextMenu-custom.js on lines 98..109

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

                              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

                                          for (var c = n - 1 >> 1; n > 0 && e.score < r[c].score; c = (n = c) - 1 >> 1) {
                                            r[n] = r[c];
                                          }
                              Severity: Major
                              Found in lib/qunit.js and 1 other location - About 2 hrs to fix
                              lib/qunit.js on lines 5550..5552

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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language