YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/resources/libraries/jstree.category.js

Summary

Maintainability
F
1 wk
Test Coverage

Function category has 265 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.jstree.plugins.category = function (options, parent) {
        this.bind = function () {
            parent.bind.call(this);
            this._data.category.selected = [];
            this.element.on(
Severity: Major
Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 day to fix

    File jstree.category.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
    /*globals jQuery, define, exports, require, document */
    (function (factory) {
        'use strict';
        if (typeof define === 'function' && define.amd) {
    Severity: Minor
    Found in public_html/layouts/resources/libraries/jstree.category.js - About 2 hrs to fix

      Function select_node has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this.select_node = function (obj, supress_event, prevent_open, e) {
                  var condition;
                  if (e.target.className.baseVal === undefined) {
                      condition = e.target.className.indexOf('noAction');
                  } else {
      Severity: Minor
      Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 hr to fix

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

                this.uncheckNode = function (obj, e, traversing = false) {
                    let cascade = this.settings.checkbox.cascade;
                    if (typeof cascade !== 'undefined' && cascade) {
                        if (cascade.indexOf('down') !== -1 && !traversing) {
                            if (this.is_closed(obj)) {
        Severity: Minor
        Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 hr to fix

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

                  this.deselect_node = function (obj, supress_event, e) {
                      if (this.get_node(obj).original.type == 'category') {
                          obj = this.get_node(obj);
                          if (obj.category.checked) {
                              this.uncheckNode(obj, e);
          Severity: Minor
          Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 hr to fix

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

                    this.checkNode = function (obj, e, traversing = false) {
                        let dom = this.get_node(obj, true);
                        this._data.category.selected.push(obj.id);
                        let cascade = this.settings.checkbox.cascade;
                        if (typeof cascade !== 'undefined' && cascade) {
            Severity: Minor
            Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 hr to fix

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

                      this.redraw_node = function (obj, deep, is_callback, force_render) {
                          obj = parent.redraw_node.apply(this, arguments);
                          if (obj) {
                              var i,
                                  j,
              Severity: Minor
              Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 hr to fix

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

                            if (dom && dom.length) {
                                let item = dom.children('.jstree-anchor').find('.jstree-category');
                                item.removeClass(options.checkClass).removeClass(options.undeterminedClass);
                                if (obj.category.checked === false) {
                                    item.addClass(options.uncheckClass);
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 7 hrs to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 213..227

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

                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 (dom && dom.length) {
                                let item = dom.children('.jstree-anchor').find('.jstree-category');
                                item.removeClass(options.uncheckClass).removeClass(options.undeterminedClass);
                                if (obj.category.checked === true) {
                                    item.addClass(options.checkClass);
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 7 hrs to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 259..273

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

                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

                                for (i = 0, j = obj.childNodes.length; i < j; i++) {
                                    if (
                                        obj.childNodes[i] &&
                                        obj.childNodes[i].className &&
                                        obj.childNodes[i].className.indexOf('jstree-anchor') !== -1
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 2 other locations - About 3 hrs to fix
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 521..530
                public_html/layouts/resources/libraries/jstree.edit.js on lines 82..91

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

                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 (typeof cascade !== 'undefined' && cascade) {
                                if (cascade.indexOf('up') !== -1) {
                                    if (obj.parent !== $.jstree.root) {
                                        let parent = this.get_node(obj.parent);
                                        this.checkNode(parent, e, 'up');
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 2 hrs to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 274..281

                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

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

                            if (typeof cascade !== 'undefined' && cascade) {
                                if (cascade.indexOf('up') !== -1) {
                                    if (obj.parent !== $.jstree.root) {
                                        let parent = this.get_node(obj.parent);
                                        this.uncheckNode(parent, e, 'up');
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 2 hrs to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 228..235

                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

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

                (function (factory) {
                    'use strict';
                    if (typeof define === 'function' && define.amd) {
                        define('jstree.category', ['jquery', 'jstree'], factory);
                    } else if (typeof exports === 'object') {
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 2 other locations - About 2 hrs to fix
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 3..1023
                public_html/layouts/resources/libraries/jstree.edit.js on lines 3..105

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

                            if (this.get_node(obj).original.type == 'category') {
                                obj = this.get_node(obj);
                                if (obj.category.checked) {
                                    this.uncheckNode(obj, e);
                                } else {
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 1 hr to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 88..129

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

                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

                            if (condition < 0 && this.get_node(obj).original.type == 'category') {
                                obj = this.get_node(obj);
                                if (obj.category.checked) {
                                    this.uncheckNode(obj, e);
                                } else {
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 1 hr to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 133..175

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

                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

                                                (m[dpc[i]].category && m[dpc[i]].category.checked) ||
                                                (m[dpc[i]].original && m[dpc[i]].original.category && m[dpc[i]].original.category.checked);
                Severity: Major
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 1 hr to fix
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 72..73

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

                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 (!supress_event) {
                                        this.trigger('changed', {
                                            action: 'deselect_node',
                                            node: obj,
                                            selected: this._data.core.selected,
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 55 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 120..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 54.

                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 (!supress_event) {
                                        this.trigger('changed', {
                                            action: 'select_node',
                                            node: obj,
                                            selected: this._data.core.selected,
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 55 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 166..173

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

                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 (this.areAllChildrenWithStates(obj, [true])) {
                                    obj.category.checked = true;
                                } else {
                                    obj.category.checked = null;
                                }
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 50 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 249..253

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

                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 (this.areAllChildrenWithStates(obj, [false])) {
                                    obj.category.checked = false;
                                } else {
                                    obj.category.checked = null;
                                }
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 50 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 205..209

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

                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 (m[dpc[i]].category.checked) {
                                                this._data.category.selected.push(dpc[i]);
                                            }
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 1 other location - About 45 mins to fix
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 74..76

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

                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._data.category.selected = $.vakata.array_remove_item(this._data.category.selected, obj.id);
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 2 other locations - About 40 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 157..157
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 788..788

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

                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._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.id);
                Severity: Minor
                Found in public_html/layouts/resources/libraries/jstree.category.js and 2 other locations - About 40 mins to fix
                public_html/layouts/resources/libraries/jstree.category.js on lines 258..258
                public_html/layouts/resources/libraries/jstree.checkbox.js on lines 788..788

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

                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