mar10/fancytree

View on GitHub

Showing 700 of 700 total issues

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 80.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 80.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function treeCreate has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        treeCreate: function (ctx) {
            this._superApply(arguments);
            this.$container.addClass("fancytree-ext-wide");

            var containerId,
Severity: Major
Found in src/jquery.fancytree.wide.js - About 2 hrs to fix

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

     /*!
     * jQuery Simulate v@VERSION - simulate browser mouse and keyboard events
     * https://github.com/jquery/jquery-simulate
     *
     * Copyright jQuery Foundation and other contributors
    Severity: Minor
    Found in lib/jquery.simulate.js - About 2 hrs to fix

      Function init has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init = jQuery.fn.init = function( selector, context, root ) {
              var match, elem;
      
              // HANDLE: $(""), $(null), $(undefined), $(false)
              if ( !selector ) {
      Severity: Major
      Found in lib/jquery.js - About 2 hrs to fix

        Function updateBreadcrumb has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function updateBreadcrumb(key, loadTreeNodes) {
                var $ol = $("ol.breadcrumb").addClass("busy"),
                    activeNode = taxonTree.getActiveNode();
        
                if (activeNode && activeNode.key !== key) {
        Severity: Major
        Found in demo/taxonomy-browser/taxonomy-browser.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 bridge has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            $.widget.bridge = function( name, object ) {
                var fullName = object.prototype.widgetFullName || name;
                $.fn[ name ] = function( options ) {
                    var isMethodCall = typeof options === "string";
                    var args = widgetSlice.call( arguments, 1 );
            Severity: Major
            Found in src/jquery-ui-dependencies/jquery.fancytree.ui-deps.js - About 2 hrs to fix

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

                  $.widget.bridge = function( name, object ) {
                      var fullName = object.prototype.widgetFullName || name;
                      $.fn[ name ] = function( options ) {
                          var isMethodCall = typeof options === "string";
                          var args = widgetSlice.call( arguments, 1 );
              Severity: Major
              Found in src/jquery-ui-dependencies/jquery-ui-iife.js - About 2 hrs to fix

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

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

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

                  $.widget.bridge = function( name, object ) {
                      var fullName = object.prototype.widgetFullName || name;
                      $.fn[ name ] = function( options ) {
                          var isMethodCall = typeof options === "string";
                          var args = widgetSlice.call( arguments, 1 );
                  Severity: Major
                  Found in src/jquery-ui-dependencies/jquery-ui.js - About 2 hrs to fix

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

                        function Test(settings) {
                          this.expected = null;
                          this.assertions = [];
                          this.module = config.currentModule;
                          this.steps = [];
                    Severity: Major
                    Found in lib/qunit.js - About 2 hrs to fix

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

                          mouseEvent: function( type, options ) {
                              var event, eventDoc, doc, body;
                              options = $.extend({
                                  bubbles: true,
                                  cancelable: (type !== "mousemove"),
                      Severity: Major
                      Found in lib/jquery.simulate.js - About 2 hrs to fix

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

                              DiffMatchPatch.prototype.diffHalfMatch = function (text1, text2) {
                                var longtext, shorttext, dmp, text1A, text2B, text2A, text1B, midCommon, hm1, hm2, hm;
                                longtext = text1.length > text2.length ? text1 : text2;
                                shorttext = text1.length > text2.length ? text2 : text1;
                          
                        Severity: Major
                        Found in lib/qunit.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 remove has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                remove: function( elem, types, handler, selector, mappedTypes ) {
                            
                                    var j, origCount, tmp,
                                        events, t, handleObj,
                                        special, handlers, type, namespaces, origType,
                            Severity: Major
                            Found in lib/jquery.js - About 2 hrs to fix

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

                                      _renderOptions: function(){
                                          var plugin = $(this.element).data("ui-" + this.options.pluginName) || $(this.element).data(this.options.pluginName),
                                              opts = this.options,
                                              actualOpts = plugin.options,
                                              availOptList = opts.optionList,
                              Severity: Major
                              Found in lib/jquery.configurator.js - About 2 hrs to fix

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

                                        treeInit: function (ctx) {
                                            var opts = ctx.options,
                                                tree = ctx.tree;
                                
                                            this._superApply(arguments);
                                Severity: Major
                                Found in src/jquery.fancytree.menu.js - About 2 hrs to fix

                                  Function init has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              init: function (options) {
                                                  var i,
                                                      opts = $.extend({}, defaultOptions, options),
                                                      hrefs = [],
                                                      $link = null,
                                  Severity: Major
                                  Found in demo/sample.js - About 2 hrs to fix

                                    Function buildFragment has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function buildFragment( elems, context, scripts, selection, ignored ) {
                                        var elem, tmp, tag, wrap, attached, j,
                                            fragment = context.createDocumentFragment(),
                                            nodes = [],
                                            i = 0,
                                    Severity: Major
                                    Found in lib/jquery.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language