ncbo/bioportal_web_ui

View on GitHub
public/widgets/jquery.ncbo.tree-2.0.1.js

Summary

Maintainability
F
3 wks
Test Coverage

Function NCBOTree has 309 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var NCBOTree = function(element, opt) {
    var _this = this;
    var OPTIONS;
    var ROOT_ID = "roots";
    var mousePressed = false;
Severity: Major
Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 1 day to fix

    File jquery.ncbo.tree-2.0.1.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    * jQuery SimpleTree Drag&Drop plugin
    * Update on 22th May 2008
    * Version 0.3
    *
    Severity: Minor
    Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 3 hrs to fix

      Function setTreeNodes has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var setTreeNodes = function(obj, useParent) {
            obj = useParent ? obj.parent() : obj;
            $('li>a', obj).addClass('text').bind('selectstart', function() {
              return false;
            }).click(function() {
      Severity: Major
      Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 2 hrs to fix

        Function setAjaxNodes has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
              if (typeof OPTIONS.beforeExpand == 'function') {
                OPTIONS.beforeExpand(node);
              }
              $TREE_CONTAINER.trigger("beforeExpand", node);
        Severity: Minor
        Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 1 hr to fix

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

              this.init = function() {
                $TREE_CONTAINER = element;
                TREE = $("<ul>").append($("<li>").addClass("root"));
                ROOT = $('.root', TREE);
                TREE.css("width", OPTIONS.width).addClass(OPTIONS.treeClass);
          Severity: Minor
          Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 1 hr to fix

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

                var formatNodes = function(nodes) {
                  var holder = $("<span>");
                  var ul = $("<ul>")
            
                  // Sort by prefLabel
            Severity: Minor
            Found in public/widgets/jquery.ncbo.tree-2.0.1.js - About 1 hr to fix

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

                  var setTreeNodes = function(obj, useParent) {
                    obj = useParent ? obj.parent() : obj;
                    $('li>a', obj).addClass('text').bind('selectstart', function() {
                      return false;
                    }).click(function() {
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 4 days to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 250..309
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 250..309

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

              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

                  var formatNodes = function(nodes) {
                    var holder = $("<span>");
                    var ul = $("<ul>")
              
                    // Sort by prefLabel
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 1 other location - About 2 days to fix
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 130..163

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

              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

                  this.init = function() {
                    $TREE_CONTAINER = element;
                    TREE = $("<ul>").append($("<li>").addClass("root"));
                    ROOT = $('.root', TREE);
                    TREE.css("width", OPTIONS.width).addClass(OPTIONS.treeClass);
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 2 days to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 357..390
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 357..390

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

              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

                  var setAjaxNodes = function(node, parentId, successCallback, errorCallback) {
                    if (typeof OPTIONS.beforeExpand == 'function') {
                      OPTIONS.beforeExpand(node);
                    }
                    $TREE_CONTAINER.trigger("beforeExpand", node);
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 1 other location - About 2 days to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 208..248

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

              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

                  this.jumpToClass = function(cls, callback) {
                    ROOT.html($("<span>").html("Loading...").css("font-size", "smaller"));
                    $.ajax({
                      url: determineHTTPS(OPTIONS.ncboAPIURL) + "/ontologies/" + OPTIONS.ontology + "/classes/" + encodeURIComponent(cls) + "/tree",
                      data: {apikey: OPTIONS.apikey, include: "prefLabel,hasChildren", no_context: true},
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 77..100
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 77..100

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

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

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

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

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

              Refactorings

              Further Reading

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

                  var initAutocomplete = function() {
                    // Add the autocomplete
                    var autocompleteContainer = $("<div>").addClass(OPTIONS.autocompleteClass).addClass("ncboTree");
                    var input = $("<input>")
                      .addClass(OPTIONS.autocompleteClass)
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 327..354
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 327..354

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

              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

                $.fn.NCBOTree = function(options) {
                  return this.each(function() {
                    var $this = $(this);
              
                    // Return early if this element already has a plugin instance
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 day to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 394..419
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 394..419

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

              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

                  var findRootNode = function(nodes) {
                    var startingRoot = (OPTIONS.startingRoot == OPTIONS.defaultRoot) ? null : OPTIONS.startingRoot;
                    if (startingRoot == null) {return nodes;}
              
                    var foundNode = false;
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 7 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 165..182
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 165..182

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

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

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

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

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

              Refactorings

              Further Reading

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

                  var nodeToggle = function(obj) {
                    var childUl = $('>ul',obj);
                    if (childUl.is(':visible')) {
                      obj.className = obj.className.replace('open','close');
                      childUl.hide();
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 5 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 193..206
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 193..206

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

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

                  this.selectedClass = function() {
                    var cls = $(TREE.find("a.active")[0]);
                    if (cls.length == 0) {
                      return null;
                    } else {
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 3 other locations - About 3 hrs to fix
              app/assets/javascripts/bp_property_tree.js on lines 120..131
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 108..119
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 108..119

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

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

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

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

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

              Refactorings

              Further Reading

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

                  var closeNearby = function(obj) {
                    $(obj).siblings().filter('.folder-open, .folder-open-last').each(function() {
                      var childUl = $('>ul',this);
                      var className = this.className;
                      this.className = className.replace('open', 'close');
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 3 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 184..191
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 184..191

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

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

                  OPTIONS = {
                    autoclose:         false,
                    beforeExpand:      false,
                    afterExpand:       false,
                    afterExpandError:  false,
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 3 other locations - About 2 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 44..62
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 44..62
              public/widgets/jquery.ncbo.tree.js on lines 38..56

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

              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

                  this.changeOntology = function(ont) {
                    var newTree = $("<ul>").append($("<li>").addClass("root"));
                    $TREE_CONTAINER.html("");
                    TREE = newTree;
                    OPTIONS.ontology = ont;
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 2 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 121..127
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 121..127

              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

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

                  this.selectClass = function(cls) {
                    var foundClass = $(TREE.find("a[data-id='" + encodeURIComponent(cls) + "']"));
                    $(TREE.find("a.active")[0]).removeClass("active");
                    foundClass.addClass("active");
                  }
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 2 hrs to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 102..106
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 102..106

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

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

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

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

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

              Refactorings

              Further Reading

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

                  var setTrigger = function(node) {
                    $('>a',node).before('<img class="trigger" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" border=0>');
                    var trigger = $('>.trigger', node);
                    trigger.click(function(event) {
                      nodeToggle(node);
              Severity: Major
              Found in public/widgets/jquery.ncbo.tree-2.0.1.js and 2 other locations - About 1 hr to fix
              public/widgets/jquery.ncbo.tree-2.0.0.js on lines 311..321
              public/widgets/jquery.ncbo.tree-2.0.2.js on lines 311..321

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 70.

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

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

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

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

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status