modxcms/revolution

View on GitHub
manager/assets/modext/widgets/core/tree/modx.tree.js

Summary

Maintainability
F
1 wk
Test Coverage

File modx.tree.js has 696 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Ext.namespace('MODx.tree');
/**
 * Generates the Tree in Ext. All modTree classes extend this base class.
 *
 * @class MODx.tree.Tree
Severity: Major
Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 day to fix

    Function _saveState has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        ,_saveState: function (n) {
            if (!this.stateful) {
                return true;
            }
            var s = Ext.state.Manager.get(this.treestate_id);
    Severity: Minor
    Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function Tree has 126 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MODx.tree.Tree = function (config) {
        config = config || {};
        Ext.applyIf(config,{
            baseParams: {}
            ,action: 'getNodes'
    Severity: Major
    Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 5 hrs to fix

      `` has 35 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Ext.extend(MODx.tree.Tree,Ext.tree.TreePanel,{
          menu: null
          ,options: {}
          ,disableHref: false
      
      
      Severity: Minor
      Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 4 hrs to fix

        Function Tree has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

        MODx.tree.Tree = function (config) {
            config = config || {};
            Ext.applyIf(config,{
                baseParams: {}
                ,action: 'getNodes'
        Severity: Minor
        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Consider simplifying this complex logical expression.
        Open

            if (this.config.url) {
                //@TODO extend TreeLoader here
                tl = new MODx.tree.TreeLoader(config.loaderConfig);
                tl.on('beforeload',function (l,node) {
                    tl.dataUrl = this.config.url + '?action=' + this.config.action + '&id=' + node.attributes.id;
        Severity: Critical
        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 2 hrs to fix

          Function _onAppend has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ,_onAppend: function (tree,parent,node) {
                  if (node.attributes.pseudoroot) {
          
                      setTimeout((function (tree) {
                          return function () {
          Severity: Major
          Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 2 hrs to fix

            Function _showContextMenu has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                ,_showContextMenu: function (node,e) {
                    this.cm.activeNode = node;
                    this.cm.removeAll();
                    var m;
                    var handled = false;
            Severity: Minor
            Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function _saveState has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                ,_saveState: function (n) {
                    if (!this.stateful) {
                        return true;
                    }
                    var s = Ext.state.Manager.get(this.treestate_id);
            Severity: Minor
            Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

              Function setup has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ,setup: function (config) {
                      config.listeners = config.listeners || {};
                      config.listeners.render = {
                          fn: function () {
                              if (config.autoExpandRoot !== false || !config.hasOwnProperty('autoExpandRoot')) {
              Severity: Minor
              Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

                Function _handleClick has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    ,_handleClick: function (n,e) {
                        e.stopEvent();
                        e.preventDefault();
                        
                        if (this.disableHref) {
                Severity: Minor
                Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function _handleDrag has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ,_handleDrag: function (dropEvent) {
                        function simplifyNodes(node) {
                            var resultNode = {};
                            var kids = node.childNodes;
                            var len = kids.length;
                Severity: Minor
                Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

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

                      ,addNodeButtons: function(node) {
                          var elId = node.ui.elNode.id + '_tools';
                          var el = document.createElement('div');
                          el.id = elId;
                          el.className = 'modx-tree-node-btn-create';
                  Severity: Minor
                  Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

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

                        ,_showContextMenu: function (node,e) {
                            this.cm.activeNode = node;
                            this.cm.removeAll();
                            var m;
                            var handled = false;
                    Severity: Minor
                    Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (s[sr].length > s[i].length) {
                                                  f = true;
                                              }
                      Severity: Major
                      Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 45 mins to fix

                        Function prepareNodes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            ,prepareNodes: function(node) {
                                var params = {};
                                if (location.search) {
                                    var parts = location.search.substring(1).split('&');
                        
                        
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 45 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function _initExpand has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            ,_initExpand: function () {
                                var treeState = Ext.state.Manager.get(this.treestate_id);
                                if (Ext.isEmpty(treeState) && this.root) {
                                    this.root.expand();
                                    if (this.root.firstChild && this.config.expandFirst) {
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function refresh has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            ,refresh: function (func,scope,args) {
                                var treeState = Ext.state.Manager.get(this.treestate_id);
                                this.root.reload();
                                if (treeState === undefined) {
                                    this.root.expand();
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                            ,encode: function (node) {
                                if (!node) {
                                    node = this.getRootNode();
                                }
                                var _encode = function (node) {
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 1 day to fix
                        manager/assets/modext/widgets/core/modx.tree.checkbox.js on lines 80..99

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

                        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 btn = MODx.load({
                                                xtype: 'modx-button',
                                                text: '',
                                                scope: this,
                                                tooltip: new Ext.ToolTip({
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 6 hrs to fix
                        manager/assets/modext/widgets/system/modx.tree.directory.js on lines 198..221

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

                        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

                                    ,listeners: {
                                        'success': {
                                            fn: function (r) {
                                                var el = dropEvent.dropNode.getUI().getTextEl();
                                                if (el) {
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 2 other locations - About 6 hrs to fix
                        manager/assets/modext/widgets/resource/modx.tree.resource.js on lines 744..755
                        manager/assets/modext/widgets/system/modx.tree.directory.js on lines 334..345

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

                        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 (location.search) {
                                    var parts = location.search.substring(1).split('&');
                        
                                    for (var i = 0; i < parts.length; i++) {
                                        var nv = parts[i].split('=');
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 4 hrs to fix
                        manager/assets/modext/widgets/system/modx.panel.filetree.js on lines 82..90

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                function simplifyNodes(node) {
                                    var resultNode = {};
                                    var kids = node.childNodes;
                                    var len = kids.length;
                                    for (var i = 0; i < len; i++) {
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 2 hrs to fix
                        manager/assets/modext/widgets/resource/modx.tree.resource.js on lines 723..731

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

                        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

                            ,loadRemoteData: function (data) {
                                this.removeChildren(this.getRootNode());
                                for (var c in data) {
                                    if (typeof data[c] === 'object') {
                                        this.getRootNode().appendChild(data[c]);
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 2 hrs to fix
                        manager/assets/modext/widgets/core/modx.tree.checkbox.js on lines 129..136

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

                        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 (config.tbar && config.useDefaultToolbar) {
                                    for (var i = 0; i < config.tbar.length; i++) {
                                        tb.push(config.tbar[i]);
                                    }
                                } else if (config.tbar) {
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 55 mins to fix
                        manager/assets/modext/widgets/core/modx.grid.js on lines 56..60

                        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

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

                            ,removeChildren: function (node) {
                                while (node.firstChild) {
                                    var c = node.firstChild;
                                    node.removeChild(c);
                                    c.destroy();
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 55 mins to fix
                        manager/assets/modext/widgets/core/modx.tree.checkbox.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 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

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

                                    if (this.getMenu) {
                                        m = this.getMenu(node,e);
                                    } else if (node.attributes.menu && node.attributes.menu.items) {
                                        m = node.attributes.menu.items;
                                    }
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 50 mins to fix
                        manager/assets/modext/widgets/system/modx.tree.directory.js on lines 169..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 51.

                        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 (m && m.length > 0) {
                                    this.addContextMenuItem(m);
                                    this.cm.showAt(e.xy);
                                }
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 1 other location - About 40 mins to fix
                        manager/assets/modext/widgets/system/modx.tree.directory.js on lines 175..178

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                return [{
                                    icon: iu + 'arrow_down.png'
                                    ,cls: 'x-btn-icon arrow_down'
                                    ,tooltip: {text: _('tree_expand')}
                                    ,handler: this.expandNodes
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 3 other locations - About 30 mins to fix
                        manager/assets/modext/widgets/core/modx.tree.column.js on lines 196..202
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 758..764
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 764..770

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 45.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                },{
                                    icon: iu + 'refresh.png'
                                    ,cls: 'x-btn-icon refresh'
                                    ,tooltip: {text: _('tree_refresh')}
                                    ,handler: this.refresh
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 3 other locations - About 30 mins to fix
                        manager/assets/modext/widgets/core/modx.tree.column.js on lines 196..202
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 752..758
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 758..764

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 45.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                },{
                                    icon: iu + 'arrow_up.png'
                                    ,cls: 'x-btn-icon arrow_up'
                                    ,tooltip: {text: _('tree_collapse')}
                                    ,handler: this.collapseNodes
                        Severity: Major
                        Found in manager/assets/modext/widgets/core/tree/modx.tree.js and 3 other locations - About 30 mins to fix
                        manager/assets/modext/widgets/core/modx.tree.column.js on lines 196..202
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 752..758
                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 764..770

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 45.

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

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

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

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

                        Refactorings

                        Further Reading

                        There are no issues that match your filters.

                        Category
                        Status