mar10/fancytree

View on GitHub

Showing 700 of 700 total issues

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

                for (var i = 0; i < searchLen; ++i) {
                  var targetI = matchesBest[i]; // score only goes down if they're not consecutive
  
                  if (lastTargetI !== targetI - 1) score -= targetI;
                  lastTargetI = targetI;
Severity: Major
Found in lib/qunit.js and 1 other location - About 1 hr to fix
lib/qunit.js on lines 5393..5398

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

            if (!$tbody.length) {
                // TODO: not sure if we can rely on browsers to insert missing <tbody> before <tr>s:
                if ($table.find(">tr").length) {
                    $.error(
                        "Expected table > tbody > tr. If you see this please open an issue."
Severity: Major
Found in src/jquery.fancytree.table.js and 1 other location - About 1 hr to fix
src/jquery.fancytree.grid.js on lines 546..554

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

            if (!$tbody.length) {
                // TODO: not sure if we can rely on browsers to insert missing <tbody> before <tr>s:
                if ($table.find(">tr").length) {
                    $.error(
                        "Expected table > tbody > tr. If you see this, please open an issue."
Severity: Major
Found in src/jquery.fancytree.grid.js and 1 other location - About 1 hr to fix
src/jquery.fancytree.table.js on lines 134..142

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

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

        nodeRenderTitle: function (ctx, title) {
            var $cb,
                res,
                tree = ctx.tree,
                node = ctx.node,
Severity: Minor
Found in src/jquery.fancytree.grid.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 mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                                      mightThrow = function() {
                                          var returned, then;
      
                                          // Support: Promises/A+ section 2.3.3.3.3
                                          // https://promisesaplus.com/#point-59
      Severity: Minor
      Found in lib/jquery.js - About 1 hr to fix

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

                _adjustColWidths: function () {
                    if (this.options.fixed.adjustColWidths) {
                        this.options.fixed.adjustColWidths.call(this);
                        return;
                    }
        Severity: Minor
        Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

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

          function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
              var i = dimension === "width" ? 1 : 0,
                  extra = 0,
                  delta = 0;
          
          
          Severity: Minor
          Found in lib/jquery.js - About 1 hr to fix

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

                    value: function throws(block, expected, message) {
                      var _validateExpectedExce = validateExpectedExceptionArgs(expected, message, 'throws');
              
                      var _validateExpectedExce2 = _slicedToArray(_validateExpectedExce, 2);
              
            Severity: Minor
            Found in lib/qunit.js - About 1 hr to fix

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

                          init: function(options) {
                              var opts = $.extend({}, defaultOptions, options),
                                  hrefs = [],
                                  $link = null,
                                  initialChoice = undefined;
              Severity: Minor
              Found in lib/jquery.skinswitcher.js - About 1 hr to fix

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

                    function createModule(name, testEnvironment, modifiers) {
                      var parentModule = moduleStack.length ? moduleStack.slice(-1)[0] : null;
                      var moduleName = parentModule !== null ? [parentModule.name, name].join(' > ') : name;
                      var parentSuite = parentModule ? parentModule.suiteReport : runSuite;
                      var skip = parentModule !== null && parentModule.skip || modifiers.skip;
                Severity: Minor
                Found in lib/qunit.js - About 1 hr to fix

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

                      handleObj.handler = function(event) {
                        //      Don't fire in text-accepting inputs that we didn't directly bind to
                        if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) ||
                            (jQuery.hotkeys.options.filterTextInputs &&
                              jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) {
                  Severity: Minor
                  Found in 3rd-party/extensions/hotkeys/js/jquery.hotkeys.js - About 1 hr to fix

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

                    function getWidthOrHeight( elem, dimension, extra ) {
                    
                        // Start with computed style
                        var styles = getStyles( elem ),
                    
                    
                    Severity: Minor
                    Found in lib/jquery.js - About 1 hr to fix

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

                              _adjustWrapperLayout: function () {
                                  var $wrapper = this.$fixedWrapper,
                                      fcn = this.options.fixed.classNames,
                                      $topLeftWrapper = $wrapper.find("div." + fcn.topLeft),
                                      $topRightWrapper = $wrapper.find("div." + fcn.topRight),
                      Severity: Minor
                      Found in src/jquery.fancytree.fixed.js - About 1 hr to fix

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

                              DiffMatchPatch.prototype.diffCompute = function (text1, text2, checklines, deadline) {
                                var diffs, longtext, shorttext, i, hm, text1A, text2A, text1B, text2B, midCommon, diffsA, diffsB;
                          
                                if (!text1) {
                                  // Just add some text (speedup).
                        Severity: Minor
                        Found in lib/qunit.js - About 1 hr to fix

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

                                      highlightCallback: function highlightCallback(result, cb) {
                                        if (result === null) return null;
                                        var target = result.target;
                                        var targetLen = target.length;
                                        var indexes = result.indexes;
                          Severity: Minor
                          Found in lib/qunit.js - About 1 hr to fix

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

                                                  if (iCurrent % 1000
                                                  /*itemsPerCheck*/
                                                  === 0) {
                                                    if (Date.now() - startMs >= 10
                                                    /*asyncInterval*/
                            Severity: Major
                            Found in lib/qunit.js and 2 other locations - About 1 hr to fix
                            lib/qunit.js on lines 4893..4902
                            lib/qunit.js on lines 4940..4949

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

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

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

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

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

                            Refactorings

                            Further Reading

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

                                                  if (iCurrent % 1000
                                                  /*itemsPerCheck*/
                                                  === 0) {
                                                    if (Date.now() - startMs >= 10
                                                    /*asyncInterval*/
                            Severity: Major
                            Found in lib/qunit.js and 2 other locations - About 1 hr to fix
                            lib/qunit.js on lines 4893..4902
                            lib/qunit.js on lines 4979..4988

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

                            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

                                                } else if (Array.isArray(r)) {
                                                    // TODO: also accept passing an object of this format directly
                                                    res = {
                                                        over: $.inArray("over", r) >= 0,
                                                        before: $.inArray("before", r) >= 0,
                            Severity: Major
                            Found in src/jquery.fancytree.dnd.js and 1 other location - About 1 hr to fix
                            src/jquery.fancytree.dnd5.js on lines 118..130

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

                            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

                                    $("#btnSearch")
                                        .click(function (event) {
                                            $("#searchResultPane").collapse("show");
                                            search($("input[name=query]").val());
                                        })
                            Severity: Major
                            Found in demo/taxonomy-browser/taxonomy-browser.js and 1 other location - About 1 hr to fix
                            demo/taxonomy-browser/taxonomy-browser-itis.js on lines 380..385

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

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

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

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

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

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language