mar10/fancytree

View on GitHub
src/jquery.fancytree.js

Summary

Maintainability
F
1 mo
Test Coverage

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

/*!
 * jquery.fancytree.js
 * Tree view control with support for lazy loading and much more.
 * https://github.com/mar10/fancytree/
 *
Severity: Major
Found in src/jquery.fancytree.js - About 2 wks to fix

    Function nodeLoadChildren has 279 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                nodeLoadChildren: function (ctx, source) {
                    var ajax,
                        delay,
                        ajaxDfd = null,
                        resultDfd,
    Severity: Major
    Found in src/jquery.fancytree.js - About 1 day to fix

      Function nodeRenderTitle has 177 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  nodeRenderTitle: function (ctx, title) {
                      // set node connector images, links and text
                      var checkbox,
                          className,
                          icon,
      Severity: Major
      Found in src/jquery.fancytree.js - About 7 hrs to fix

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

                    nodeSetExpanded: function (ctx, flag, callOpts) {
                        callOpts = callOpts || {};
                        var _afterLoad,
                            dfd,
                            i,
        Severity: Major
        Found in src/jquery.fancytree.js - About 6 hrs to fix

          Function _bind has 144 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      _bind: function () {
                          var self = this,
                              opts = this.options,
                              tree = this.tree,
                              ns = tree._ns;
          Severity: Major
          Found in src/jquery.fancytree.js - About 5 hrs to fix

            Function nodeRender has 132 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        nodeRender: function (ctx, force, deep, collapsed, _recursive) {
                            /* This method must take care of all cases where the current data mode
                             * (i.e. node hierarchy) does not match the current markup.
                             *
                             * - node was not yet rendered:
            Severity: Major
            Found in src/jquery.fancytree.js - About 5 hrs to fix

              Function scrollIntoView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      scrollIntoView: function (effects, options) {
                          if (options !== undefined && _isNode(options)) {
                              throw Error(
                                  "scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead."
                              );
              Severity: Major
              Found in src/jquery.fancytree.js - About 4 hrs to fix

                Function fixSelection3FromEndNodes has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        fixSelection3FromEndNodes: function (callOpts) {
                            var opts = this.tree.options;
                
                            // this.debug("fixSelection3FromEndNodes()");
                            _assert(opts.selectMode === 3, "expected selectMode 3");
                Severity: Major
                Found in src/jquery.fancytree.js - About 4 hrs to fix

                  Function nodeSetStatus has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              nodeSetStatus: function (ctx, status, message, details) {
                                  var node = ctx.node,
                                      tree = ctx.tree;
                  
                                  function _clearStatusNode() {
                  Severity: Major
                  Found in src/jquery.fancytree.js - About 3 hrs to fix

                    Function nodeRenderStatus has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                nodeRenderStatus: function (ctx) {
                                    // Set classes for current status
                                    var $ariaElem,
                                        node = ctx.node,
                                        tree = ctx.tree,
                    Severity: Major
                    Found in src/jquery.fancytree.js - About 3 hrs to fix

                      Function treeLoad has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  treeLoad: function (ctx, source) {
                                      var metaData,
                                          type,
                                          $ul,
                                          tree = ctx.tree,
                      Severity: Major
                      Found in src/jquery.fancytree.js - About 3 hrs to fix

                        Function nodeKeydown has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    nodeKeydown: function (ctx) {
                                        // TODO: return promise?
                                        var matchNode,
                                            stamp,
                                            _res,
                        Severity: Major
                        Found in src/jquery.fancytree.js - About 3 hrs to fix

                          Function _loadKeyPathImpl has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  _loadKeyPathImpl: function (dfd, opts, parent, pathSegList) {
                                      var deferredList,
                                          i,
                                          key,
                                          node,
                          Severity: Major
                          Found in src/jquery.fancytree.js - About 3 hrs to fix

                            Function parseHtml has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        parseHtml: function ($ul) {
                                            var classes,
                                                className,
                                                extraClasses,
                                                i,
                            Severity: Major
                            Found in src/jquery.fancytree.js - About 3 hrs to fix

                              Function moveTo has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      moveTo: function (targetNode, mode, map) {
                                          if (mode === undefined || mode === "over") {
                                              mode = "child";
                                          } else if (mode === "firstChild") {
                                              if (targetNode.children && targetNode.children.length) {
                              Severity: Major
                              Found in src/jquery.fancytree.js - About 3 hrs to fix

                                Function nodeSetActive has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            nodeSetActive: function (ctx, flag, callOpts) {
                                                // Handle user click / [space] / [enter], according to clickFolderMode.
                                                callOpts = callOpts || {};
                                                var subCtx,
                                                    node = ctx.node,
                                Severity: Major
                                Found in src/jquery.fancytree.js - About 3 hrs to fix

                                  Function _create has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              _create: function () {
                                                  this.tree = new Fancytree(this);
                                  
                                                  this.$source =
                                                      this.source || this.element.data("type") === "json"
                                  Severity: Major
                                  Found in src/jquery.fancytree.js - About 2 hrs to fix

                                    Function FancytreeNode has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function FancytreeNode(parent, obj) {
                                            var i, l, name, cl;
                                    
                                            this.parent = parent;
                                            this.tree = parent.tree;
                                    Severity: Major
                                    Found in src/jquery.fancytree.js - About 2 hrs to fix

                                      Function findRelatedNode has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              findRelatedNode: function (node, where, includeHidden) {
                                                  var res = null,
                                                      KC = $.ui.keyCode;
                                      
                                                  switch (where) {
                                      Severity: Major
                                      Found in src/jquery.fancytree.js - About 2 hrs to fix

                                        Function treeSetOption has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                    treeSetOption: function (ctx, key, value) {
                                                        var tree = ctx.tree,
                                                            callDefault = true,
                                                            callCreate = false,
                                                            callRender = false;
                                        Severity: Major
                                        Found in src/jquery.fancytree.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 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 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 _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

                                                    Function nodeSetFocus has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                                nodeSetFocus: function (ctx, flag) {
                                                                    // ctx.node.debug("nodeSetFocus(" + flag + ")");
                                                                    var ctx2,
                                                                        tree = ctx.tree,
                                                                        node = ctx.node,
                                                    Severity: Major
                                                    Found in src/jquery.fancytree.js - About 2 hrs to fix

                                                      Function nodeSetSelected has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                                  nodeSetSelected: function (ctx, flag, callOpts) {
                                                                      callOpts = callOpts || {};
                                                                      var node = ctx.node,
                                                                          tree = ctx.tree,
                                                                          opts = ctx.options,
                                                      Severity: Major
                                                      Found in src/jquery.fancytree.js - About 2 hrs to fix

                                                        Function addChildren has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                addChildren: function (children, insertBefore) {
                                                                    var i,
                                                                        l,
                                                                        pos,
                                                                        origFirstChild = this.getFirstChild(),
                                                        Severity: Minor
                                                        Found in src/jquery.fancytree.js - About 1 hr to fix

                                                          Function _requireExtension has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  _requireExtension: function (name, required, before, message) {
                                                                      if (before != null) {
                                                                          before = !!before;
                                                                      }
                                                                      var thisName = this._local.name,
                                                          Severity: Minor
                                                          Found in src/jquery.fancytree.js - About 1 hr to fix

                                                            Function loadKeyPath has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    loadKeyPath: function (keyPathList, optsOrCallback) {
                                                                        var callback,
                                                                            i,
                                                                            path,
                                                                            self = this,
                                                            Severity: Minor
                                                            Found in src/jquery.fancytree.js - About 1 hr to fix

                                                              Function _changeSelectStatusAttrs has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                      _changeSelectStatusAttrs: function (state) {
                                                                          var changed = false,
                                                                              opts = this.tree.options,
                                                                              unselectable = FT.evalOption(
                                                                                  "unselectable",
                                                              Severity: Minor
                                                              Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                Function toDict has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        toDict: function (recursive, callback) {
                                                                            var i,
                                                                                l,
                                                                                node,
                                                                                res,
                                                                Severity: Minor
                                                                Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                  Function nodeClick has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                              nodeClick: function (ctx) {
                                                                                  var activate,
                                                                                      expand,
                                                                                      // event = ctx.originalEvent,
                                                                                      targetType = ctx.targetType,
                                                                  Severity: Minor
                                                                  Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                    Function applyPatch has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                            applyPatch: function (patch) {
                                                                                // patch [key, null] means 'remove'
                                                                                if (patch === null) {
                                                                                    this.remove();
                                                                                    return _getResolvedPromise(this);
                                                                    Severity: Minor
                                                                    Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                      Function _visitRowsUp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                              _visitRowsUp: function (fn, opts) {
                                                                                  var children,
                                                                                      idx,
                                                                                      parent,
                                                                                      includeHidden = !!opts.includeHidden,
                                                                      Severity: Minor
                                                                      Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                        Function _simpleDeepMerge has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                            function _simpleDeepMerge() {
                                                                                var options,
                                                                                    name,
                                                                                    src,
                                                                                    copy,
                                                                        Severity: Minor
                                                                        Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                          Function _subclassObject has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                              function _subclassObject(tree, base, extension, extName) {
                                                                                  // $.ui.fancytree.debug("_subclassObject", tree, base, extension, extName);
                                                                                  for (var attrName in extension) {
                                                                                      if (typeof extension[attrName] === "function") {
                                                                                          if (typeof tree[attrName] === "function") {
                                                                          Severity: Minor
                                                                          Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                            Function getEventTarget has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                                        getEventTarget: function (event) {
                                                                                            var $target,
                                                                                                tree,
                                                                                                tcn = event && event.target ? event.target.className : "",
                                                                                                res = { node: this.getNode(event.target), type: undefined };
                                                                            Severity: Minor
                                                                            Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                              Function nodeRemoveChild has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                          nodeRemoveChild: function (ctx, childNode) {
                                                                                              var idx,
                                                                                                  node = ctx.node,
                                                                                                  // opts = ctx.options,
                                                                                                  subCtx = $.extend({}, ctx, { node: childNode }),
                                                                              Severity: Minor
                                                                              Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                Function load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                        load: function (forceReload) {
                                                                                            var res,
                                                                                                source,
                                                                                                self = this,
                                                                                                wasExpanded = this.isExpanded();
                                                                                Severity: Minor
                                                                                Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                  Function _makeHookContext has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                          _makeHookContext: function (obj, originalEvent, extra) {
                                                                                              var ctx, tree;
                                                                                              if (obj.node !== undefined) {
                                                                                                  // obj is already a context object
                                                                                                  if (originalEvent && obj.originalEvent !== originalEvent) {
                                                                                  Severity: Minor
                                                                                  Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                    Function visitAndLoad has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                            visitAndLoad: function (fn, includeSelf, _recursion) {
                                                                                                var dfd,
                                                                                                    res,
                                                                                                    loaders,
                                                                                                    node = this;
                                                                                    Severity: Minor
                                                                                    Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                      Function toggleClass has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                              toggleClass: function (value, flag) {
                                                                                                  var className,
                                                                                                      hasClass,
                                                                                                      rnotwhite = /\S+/g,
                                                                                                      classNames = value.match(rnotwhite) || [],
                                                                                      Severity: Minor
                                                                                      Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                        Function treeInit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                                    treeInit: function (ctx) {
                                                                                                        var tree = ctx.tree,
                                                                                                            opts = tree.options;
                                                                                        
                                                                                                        //this.debug("Fancytree.treeInit()");
                                                                                        Severity: Minor
                                                                                        Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                          Function navigate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                                  navigate: function (where, activate) {
                                                                                                      var node,
                                                                                                          KC = $.ui.keyCode;
                                                                                          
                                                                                                      // Handle optional expand/collapse action for LEFT/RIGHT
                                                                                          Severity: Minor
                                                                                          Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                        getTree: function (el) {
                                                                                                            var widget,
                                                                                                                orgEl = el;
                                                                                            
                                                                                                            if (el instanceof Fancytree) {
                                                                                            Severity: Minor
                                                                                            Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                          fixPositionOptions: function (opts) {
                                                                                                              if (opts.offset || ("" + opts.my + opts.at).indexOf("%") >= 0) {
                                                                                                                  $.error(
                                                                                                                      "expected new position syntax (but '%' is not supported)"
                                                                                                                  );
                                                                                              Severity: Minor
                                                                                              Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                            nodeRemoveChildren: function (ctx) {
                                                                                                                var //subCtx,
                                                                                                                    tree = ctx.tree,
                                                                                                                    node = ctx.node,
                                                                                                                    children = node.children;
                                                                                                Severity: Minor
                                                                                                Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                                  Function _makeVirtualFunction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                      function _makeVirtualFunction(methodName, tree, base, extension, extName) {
                                                                                                          // $.ui.fancytree.debug("_makeVirtualFunction", methodName, tree, base, extension, extName);
                                                                                                          // if(rexTestSuper && !rexTestSuper.test(func)){
                                                                                                          //     // extension.methodName() doesn't call _super(), so no wrapper required
                                                                                                          //     return func;
                                                                                                  Severity: Minor
                                                                                                  Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                            findNextNode: function (match, startNode) {
                                                                                                                //, visibleOnly) {
                                                                                                                var res = null,
                                                                                                                    firstNode = this.getFirstChild();
                                                                                                    
                                                                                                    
                                                                                                    Severity: Minor
                                                                                                    Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                              applyPatch: function (patchList) {
                                                                                                                  var dfd,
                                                                                                                      i,
                                                                                                                      p2,
                                                                                                                      key,
                                                                                                      Severity: Minor
                                                                                                      Found in src/jquery.fancytree.js - About 1 hr to fix

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

                                                                                                                    eventToString: function (event) {
                                                                                                                        // Poor-man's hotkeys. See here for a complete implementation:
                                                                                                                        //   https://github.com/jeresig/jquery.hotkeys
                                                                                                                        var which = event.which,
                                                                                                                            et = event.type,
                                                                                                        Severity: Minor
                                                                                                        Found in src/jquery.fancytree.js - About 1 hr to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                  if (target === copy) {
                                                                                                                                      continue;
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in src/jquery.fancytree.js - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                    if (copy && $.isPlainObject(copy)) {
                                                                                                                                        clone = src && $.isPlainObject(src) ? src : {};
                                                                                                                                        // Never move original objects, clone them
                                                                                                                                        target[name] = _simpleDeepMerge(clone, copy);
                                                                                                                                        // Don't bring in undefined values
                                                                                                            Severity: Major
                                                                                                            Found in src/jquery.fancytree.js - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                          if (res !== false) {
                                                                                                                                              dict.children.push(res);
                                                                                                                                          }
                                                                                                              Severity: Major
                                                                                                              Found in src/jquery.fancytree.js - About 45 mins to fix

                                                                                                                Function _makeVirtualFunction has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                    function _makeVirtualFunction(methodName, tree, base, extension, extName) {
                                                                                                                Severity: Minor
                                                                                                                Found in src/jquery.fancytree.js - About 35 mins to fix

                                                                                                                  Function evalOption has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                                  optionName,
                                                                                                                                  node,
                                                                                                                                  nodeObject,
                                                                                                                                  treeOptions,
                                                                                                                                  defaultValue
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/jquery.fancytree.js - About 35 mins to fix

                                                                                                                    Function nodeRender has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                                nodeRender: function (ctx, force, deep, collapsed, _recursive) {
                                                                                                                    Severity: Minor
                                                                                                                    Found in src/jquery.fancytree.js - About 35 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                                          return tree._triggerNodeEvent(
                                                                                                                                                              "dblclick",
                                                                                                                                                              ctx,
                                                                                                                                                              event
                                                                                                                                                          ) === false
                                                                                                                      Severity: Major
                                                                                                                      Found in src/jquery.fancytree.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                            return _getRejectedPromise(node, ["rejected"]);
                                                                                                                        Severity: Major
                                                                                                                        Found in src/jquery.fancytree.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                      return !!(this.children && this.children.length);
                                                                                                                          Severity: Major
                                                                                                                          Found in src/jquery.fancytree.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                        return true;
                                                                                                                            Severity: Major
                                                                                                                            Found in src/jquery.fancytree.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                          return _getResolvedPromise();
                                                                                                                              Severity: Major
                                                                                                                              Found in src/jquery.fancytree.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                                return dfd.promise();
                                                                                                                                Severity: Major
                                                                                                                                Found in src/jquery.fancytree.js - About 30 mins to fix

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

                                                                                                                                                          try {
                                                                                                                                                              tree.phase = "userEvent";
                                                                                                                                                              switch (event.type) {
                                                                                                                                                                  case "click":
                                                                                                                                                                      ctx.targetType = et.type;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 6 hrs to fix
                                                                                                                                  src/jquery.fancytree.fixed.js on lines 156..186

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

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

                                                                                                                                  (function (factory) {
                                                                                                                                      if (typeof define === "function" && define.amd) {
                                                                                                                                          // AMD. Register as an anonymous module.
                                                                                                                                          define(["jquery", "./jquery.fancytree.ui-deps"], factory);
                                                                                                                                      } else if (typeof module === "object" && module.exports) {
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 15 other locations - About 3 hrs to fix
                                                                                                                                  src/jquery.fancytree.childcounter.js on lines 31..241
                                                                                                                                  src/jquery.fancytree.clones.js on lines 16..514
                                                                                                                                  src/jquery.fancytree.columnview.js on lines 16..205
                                                                                                                                  src/jquery.fancytree.dnd5.js on lines 29..1157
                                                                                                                                  src/jquery.fancytree.edit.js on lines 16..403
                                                                                                                                  src/jquery.fancytree.filter.js on lines 16..549
                                                                                                                                  src/jquery.fancytree.glyph.js on lines 16..354
                                                                                                                                  src/jquery.fancytree.grid.js on lines 16..1014
                                                                                                                                  src/jquery.fancytree.logger.js on lines 16..309
                                                                                                                                  src/jquery.fancytree.menu.js on lines 18..185
                                                                                                                                  src/jquery.fancytree.multi.js on lines 16..128
                                                                                                                                  src/jquery.fancytree.persist.js on lines 18..513
                                                                                                                                  src/jquery.fancytree.table.js on lines 16..545
                                                                                                                                  src/jquery.fancytree.themeroller.js on lines 18..125
                                                                                                                                  src/jquery.fancytree.wide.js on lines 15..257

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

                                                                                                                                  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

                                                                                                                                      function _getResolvedPromise(context, argArray) {
                                                                                                                                          if (context === undefined) {
                                                                                                                                              return $.Deferred(function () {
                                                                                                                                                  this.resolve();
                                                                                                                                              }).promise();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 2 hrs to fix
                                                                                                                                  src/jquery.fancytree.js on lines 430..439

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

                                                                                                                                  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

                                                                                                                                      function _getRejectedPromise(context, argArray) {
                                                                                                                                          if (context === undefined) {
                                                                                                                                              return $.Deferred(function () {
                                                                                                                                                  this.reject();
                                                                                                                                              }).promise();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 2 hrs to fix
                                                                                                                                  src/jquery.fancytree.js on lines 419..428

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

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

                                                                                                                                          info: function (msg) {
                                                                                                                                              if (this.tree.options.debugLevel >= 3) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("info", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 2 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 940..945
                                                                                                                                  src/jquery.fancytree.js on lines 2619..2624

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

                                                                                                                                          warn: function (msg) {
                                                                                                                                              if (this.tree.options.debugLevel >= 2) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("warn", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 2 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 940..945
                                                                                                                                  src/jquery.fancytree.js on lines 1456..1461

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

                                                                                                                                          error: function (msg) {
                                                                                                                                              if (this.tree.options.debugLevel >= 1) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("error", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 2 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 1456..1461
                                                                                                                                  src/jquery.fancytree.js on lines 2619..2624

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

                                                                                                                                          debug: function (msg) {
                                                                                                                                              if (this.options.debugLevel >= 4) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("log", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 3 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3143..3148
                                                                                                                                  src/jquery.fancytree.js on lines 3503..3508
                                                                                                                                  src/jquery.fancytree.js on lines 4033..4038

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

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

                                                                                                                                          error: function (msg) {
                                                                                                                                              if (this.options.debugLevel >= 1) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("error", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 3 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3092..3097
                                                                                                                                  src/jquery.fancytree.js on lines 3503..3508
                                                                                                                                  src/jquery.fancytree.js on lines 4033..4038

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

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

                                                                                                                                          info: function (msg) {
                                                                                                                                              if (this.options.debugLevel >= 3) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("info", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 3 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3092..3097
                                                                                                                                  src/jquery.fancytree.js on lines 3143..3148
                                                                                                                                  src/jquery.fancytree.js on lines 4033..4038

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

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

                                                                                                                                          warn: function (msg) {
                                                                                                                                              if (this.options.debugLevel >= 2) {
                                                                                                                                                  Array.prototype.unshift.call(arguments, this.toString());
                                                                                                                                                  consoleApply("warn", arguments);
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 3 other locations - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3092..3097
                                                                                                                                  src/jquery.fancytree.js on lines 3143..3148
                                                                                                                                  src/jquery.fancytree.js on lines 3503..3508

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

                                                                                                                                  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

                                                                                                                                                                      always: function () {
                                                                                                                                                                          // node.debug("fancytree-animating end: " + node.li.className);
                                                                                                                                                                          $(this).removeClass(cn.animating); // #716
                                                                                                                                                                          $(node.li).removeClass(cn.animating); // #717
                                                                                                                                                                          callback();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 5593..5598

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

                                                                                                                                  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

                                                                                                                                                                      function () {
                                                                                                                                                                          // node.debug("fancytree-animating end: " + node.li.className);
                                                                                                                                                                          $(this).removeClass(cn.animating); // #716
                                                                                                                                                                          $(node.li).removeClass(cn.animating); // #717
                                                                                                                                                                          callback();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 5564..5569

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

                                                                                                                                  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

                                                                                                                                                                  $.each(TREE_ATTRS, function (i, attr) {
                                                                                                                                                                      if (metaData[attr] !== undefined) {
                                                                                                                                                                          tree[attr] = metaData[attr];
                                                                                                                                                                          delete metaData[attr];
                                                                                                                                                                      }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 4536..4541

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

                                                                                                                                  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

                                                                                                                                                              $.each(TREE_ATTRS, function (i, attr) {
                                                                                                                                                                  if (metaData[attr] !== undefined) {
                                                                                                                                                                      tree[attr] = metaData[attr];
                                                                                                                                                                      delete metaData[attr];
                                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 6094..6099

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

                                                                                                                                  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

                                                                                                                                                              _setStatusNode(
                                                                                                                                                                  {
                                                                                                                                                                      title:
                                                                                                                                                                          tree.options.strings.loading +
                                                                                                                                                                          (message ? " (" + message + ")" : ""),
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 5898..5908

                                                                                                                                  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

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

                                                                                                                                                          _setStatusNode(
                                                                                                                                                              {
                                                                                                                                                                  title:
                                                                                                                                                                      tree.options.strings.loadError +
                                                                                                                                                                      (message ? " (" + message + ")" : ""),
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 5881..5891

                                                                                                                                  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

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

                                                                                                                                                  case "activate":
                                                                                                                                                      this.tree.timer = setTimeout(function () {
                                                                                                                                                          self.tree.debug("setTimeout: trigger activate");
                                                                                                                                                          self.setActive(true);
                                                                                                                                                      }, ms);
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 2076..2081

                                                                                                                                  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

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

                                                                                                                                                  case "expand":
                                                                                                                                                      this.tree.timer = setTimeout(function () {
                                                                                                                                                          self.tree.debug("setTimeout: trigger expand");
                                                                                                                                                          self.setExpanded(true);
                                                                                                                                                      }, ms);
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 2082..2087

                                                                                                                                  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

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

                                                                                                                                          debugTimeEnd: function (label) {
                                                                                                                                              if (this.options.debugLevel >= 4) {
                                                                                                                                                  window.console.timeEnd(this + " - " + label);
                                                                                                                                              }
                                                                                                                                          },
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3828..3832

                                                                                                                                  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

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

                                                                                                                                          debugTime: function (label) {
                                                                                                                                              if (this.options.debugLevel >= 4) {
                                                                                                                                                  window.console.time(this + " - " + label);
                                                                                                                                              }
                                                                                                                                          },
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 1 hr to fix
                                                                                                                                  src/jquery.fancytree.js on lines 3838..3842

                                                                                                                                  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

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

                                                                                                                                                          if (node.key && opts.generateIds) {
                                                                                                                                                              node.li.id = opts.idPrefix + node.key;
                                                                                                                                                          }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in src/jquery.fancytree.js and 2 other locations - About 35 mins to fix
                                                                                                                                  src/jquery.fancytree.grid.js on lines 811..813
                                                                                                                                  src/jquery.fancytree.table.js on lines 313..315

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

                                                                                                                                  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

                                                                                                                                                  case "moveDown":
                                                                                                                                                      refNode = node.getNextSibling();
                                                                                                                                                      if (refNode) {
                                                                                                                                                          node.moveTo(refNode, "after");
                                                                                                                                                          node.setActive();
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 30 mins to fix
                                                                                                                                  src/jquery.fancytree.js on lines 2949..2955

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

                                                                                                                                  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

                                                                                                                                                  case "moveUp":
                                                                                                                                                      refNode = node.getPrevSibling();
                                                                                                                                                      if (refNode) {
                                                                                                                                                          node.moveTo(refNode, "before");
                                                                                                                                                          node.setActive();
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in src/jquery.fancytree.js and 1 other location - About 30 mins to fix
                                                                                                                                  src/jquery.fancytree.js on lines 2956..2962

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

                                                                                                                                  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