modxcms/revolution

View on GitHub
manager/assets/modext/widgets/element/modx.panel.plugin.js

Summary

Maintainability
F
2 wks
Test Coverage

Function Plugin has 305 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MODx.panel.Plugin = function(config) {
    config = config || {};
    config.record = config.record || {};
    config = MODx.setStaticElementsConfig(config, 'plugin');

Severity: Major
Found in manager/assets/modext/widgets/element/modx.panel.plugin.js - About 1 day to fix

    File modx.panel.plugin.js has 400 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     *
     * @class MODx.panel.Plugin
     * @extends MODx.FormPanel
     * @param {Object} config An object of config properties
    Severity: Minor
    Found in manager/assets/modext/widgets/element/modx.panel.plugin.js - About 5 hrs to fix

      Function Plugin has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      MODx.panel.Plugin = function(config) {
          config = config || {};
          config.record = config.record || {};
          config = MODx.setStaticElementsConfig(config, 'plugin');
      
      
      Severity: Minor
      Found in manager/assets/modext/widgets/element/modx.panel.plugin.js - About 4 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 toggleStaticFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          ,toggleStaticFile: function(cb) {
              var flds = ['modx-plugin-static-file','modx-plugin-static-file-help','modx-plugin-static-source','modx-plugin-static-source-help'];
              var fld,i;
              if (cb.checked) {
                  for (i in flds) {
      Severity: Minor
      Found in manager/assets/modext/widgets/element/modx.panel.plugin.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 setup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ,setup: function() {
      
              if (!this.initialized) {
                  /*
                      The itemId (not id) of each form tab to be included/excluded; these correspond to the
      Severity: Minor
      Found in manager/assets/modext/widgets/element/modx.panel.plugin.js - About 1 hr to fix

        Function setup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            ,setup: function() {
        
                if (!this.initialized) {
                    /*
                        The itemId (not id) of each form tab to be included/excluded; these correspond to the
        Severity: Minor
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js - About 55 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 success has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            ,success: function(o) {
                if (MODx.request.id) Ext.getCmp('modx-grid-element-properties').save();
                Ext.getCmp('modx-grid-plugin-event').getStore().commitChanges();
                this.getForm().setValues(o.result.object);
        
        
        Severity: Minor
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.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

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

                            },{
                                xtype: 'textfield'
                                ,fieldLabel: _('name')+'<span class="required">*</span>'
                                ,description: MODx.expandHelp ? '' : _('plugin_desc_name')
                                ,name: 'name'
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 1 day to fix
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 65..89
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 66..90
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 71..95

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

        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

            ,success: function(o) {
                if (MODx.request.id) Ext.getCmp('modx-grid-element-properties').save();
                Ext.getCmp('modx-grid-plugin-event').getStore().commitChanges();
                this.getForm().setValues(o.result.object);
        
        
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 1 other location - About 1 day to fix
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 385..398

        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

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

                            },{
                                xtype: 'modx-combo-browser'
                                ,browserEl: 'modx-browser'
                                ,fieldLabel: _('static_file')
                                ,description: MODx.expandHelp ? '' : _('static_file_msg')
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 2 other locations - About 1 day to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 107..134
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 108..135

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

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

                            },{
                                xtype: 'modx-combo-source'
                                ,fieldLabel: _('static_source')
                                ,description: MODx.expandHelp ? '' : _('static_source_msg')
                                ,name: 'source'
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 4 other locations - About 6 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 212..234
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 213..235
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 227..249
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 230..252

        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

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

            ,changeEditor: function() {
                this.cleanupEditor();
                this.on('success',function(o) {
                    var id = o.result.object.id;
                    var w = Ext.getCmp('modx-plugin-which-editor').getValue();
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 2 other locations - About 5 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 360..369
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 399..408

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

        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

                            ,items: [{
                                xtype: 'modx-combo-category'
                                ,fieldLabel: _('category')
                                ,description: MODx.expandHelp ? '' : _('plugin_desc_category')
                                ,name: 'category'
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 5 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 148..164
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 149..165
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 164..180

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

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

            ,toggleStaticFile: function(cb) {
                var flds = ['modx-plugin-static-file','modx-plugin-static-file-help','modx-plugin-static-source','modx-plugin-static-source-help'];
                var fld,i;
                if (cb.checked) {
                    for (i in flds) {
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 4 other locations - About 5 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 368..382
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 376..390
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 415..429
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 485..499

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

        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

                if (!Ext.isEmpty(this.config.record.name)) {
                    var title = _('plugin')+': '+this.config.record.name;
                    if (MODx.perm.tree_show_element_ids === 1) {
                        title = title+ ' <small>('+this.config.record.id+')</small>';
                    }
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 5 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 305..311
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 305..311
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 397..403

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

        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

            ,beforeSubmit: function(o) {
                var g = Ext.getCmp('modx-grid-plugin-event');
                Ext.apply(o.form.baseParams,{
                    events: g.encodeModified()
                    ,propdata: Ext.getCmp('modx-grid-element-properties').encode()
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 1 other location - About 4 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 373..384

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

        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

                ,listeners: {
                    'setup': {fn:this.setup,scope:this}
                    ,'success': {fn:this.success,scope:this}
                    ,'failure': {fn:this.failure,scope:this}
                    ,'beforeSubmit': {fn:this.beforeSubmit,scope:this}
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 4 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 270..281
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 271..282
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 307..318

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

        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

                if (!Ext.isEmpty(this.config.record.properties)) {
                    var d = this.config.record.properties;
                    var g = Ext.getCmp('modx-grid-element-properties');
                    if (g) {
                        g.defaultProperties = d;
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 3 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 312..319
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 312..319
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 348..355

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

        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

                    },{
                        xtype: 'panel'
                        ,border: false
                        ,layout: 'form'
                        ,cls:'main-wrapper'
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 2 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 244..259
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 245..260
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 259..274

        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

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

                            },{
                                xtype: 'xcheckbox'
                                ,boxLabel: _('clear_cache_on_save')
                                ,description: MODx.expandHelp ? '' : _('clear_cache_on_save_msg')
                                ,hideLabel: true
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 3 other locations - About 2 hrs to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 182..192
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 184..193
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 198..207

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 80.

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

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

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

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

        Refactorings

        Further Reading

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

                            },{
                                xtype: 'xcheckbox'
                                ,hideLabel: true
                                ,boxLabel: _('is_static')
                                ,description: MODx.expandHelp ? '' : _('is_static_msg')
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 4 other locations - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 197..206
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 198..207
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 212..221
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 215..224

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

        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.initialized) {
                    /*
                        The itemId (not id) of each form tab to be included/excluded; these correspond to the
                        keys in each tab component's items property
                    */
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 1 other location - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 328..337

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

        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

                            },{
                                xtype: 'textarea'
                                ,fieldLabel: _('plugin_desc')
                                ,description: MODx.expandHelp ? '' : _('plugin_desc_description')
                                ,name: 'description'
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 1 other location - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 93..102

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

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

            ,changeSource: function() {
                var browser = Ext.getCmp('modx-plugin-static-file')
                    ,source = Ext.getCmp('modx-plugin-static-source').getValue();
        
                browser.config.source = source;
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 4 other locations - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 331..336
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 330..335
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 367..372
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 432..437

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

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

                            },{
                                xtype: MODx.expandHelp ? 'label' : 'hidden'
                                ,forId: 'modx-plugin-static-file'
                                ,id: 'modx-plugin-static-file-help'
                                ,html: _('static_file_msg')
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 9 other locations - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 134..142
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 234..242
        manager/assets/modext/widgets/element/modx.panel.plugin.js on lines 251..259
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 135..143
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 235..243
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 134..142
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 249..257
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 142..150
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 252..260

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

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

                            },{
                                xtype: MODx.expandHelp ? 'label' : 'hidden'
                                ,forId: 'modx-plugin-static-source'
                                ,id: 'modx-plugin-static-source-help'
                                ,html: _('static_source_msg')
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 9 other locations - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 134..142
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 234..242
        manager/assets/modext/widgets/element/modx.panel.plugin.js on lines 136..144
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 135..143
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 235..243
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 134..142
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 249..257
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 142..150
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 252..260

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

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

                        ,defaults: {
                            layout: 'form'
                            ,labelAlign: 'top'
                            ,anchor: '100%'
                            ,border: false
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 4 other locations - About 1 hr to fix
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 39..51
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 40..52
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 41..53
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 46..58

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

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

            ,cleanupEditor: function() {
                if (MODx.onSaveEditor) {
                    var fld = Ext.getCmp('modx-plugin-plugincode');
                    MODx.onSaveEditor(fld);
                }
        Severity: Major
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 6 other locations - About 35 mins to fix
        manager/assets/modext/sections/system/file/create.js on lines 139..144
        manager/assets/modext/sections/system/file/edit.js on lines 157..162
        manager/assets/modext/widgets/element/modx.panel.chunk.js on lines 362..367
        manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 370..375
        manager/assets/modext/widgets/element/modx.panel.template.js on lines 409..414
        manager/assets/modext/widgets/element/modx.panel.tv.js on lines 478..483

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

        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

                        ,listeners: {
                            'updateEvent': {fn:this.markDirty,scope:this}
                            ,'rowclick': {fn:this.markDirty,scope:this}
                        }
        Severity: Minor
        Found in manager/assets/modext/widgets/element/modx.panel.plugin.js and 1 other location - About 35 mins to fix
        manager/assets/modext/widgets/security/modx.grid.user.group.js on lines 44..47

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

        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