modxcms/revolution

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

Summary

Maintainability
F
1 wk
Test Coverage

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

MODx.panel.Resource = function(config) {
    config = config || {record:{}};
    config.record = config.record || {};
    Ext.applyIf(config,{
        url: MODx.config.connector_url
Severity: Major
Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 days to fix

    Function setup has a Cognitive Complexity of 46 (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/resource/modx.panel.resource.js - About 7 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 getMainFields has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ,getMainFields: function(config) {
            config = config || {record:{}};
            return [{
                layout:'column'
                ,border: false
    Severity: Major
    Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 3 hrs to fix

      Function getMainRightFields has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ,getMainRightFields: function(config) {
              config = config || {};
      
              var aliasLength = ~~MODx.config['friendly_alias_max_length'] || 0;
      
      
      Severity: Major
      Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

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

        Ext.extend(MODx.panel.Resource,MODx.FormPanel,{
            initialized: false
            ,defaultClassKey: 'modDocument'
            ,classLexiconKey: 'document'
            ,rteElements: 'ta'
        Severity: Minor
        Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

          Function getFields has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ,getFields: function(config) {
                  var it = [];
                  it.push({
                      title: _(this.classLexiconKey)
                      ,id: 'modx-resource-settings'
          Severity: Major
          Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

            Function setup has 67 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: Major
            Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

              Function success has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  ,success: function(o) {
                      this.warnUnsavedChanges = false;
                      var g = Ext.getCmp('modx-grid-resource-security');
                      if (g) { g.getStore().commitChanges(); }
                      var t = Ext.getCmp('modx-resource-tree');
              Severity: Minor
              Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 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 getSettingRightFieldsetLeft has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ,getSettingRightFieldsetLeft: function(config) {
                      return [{
                          xtype: 'xcheckbox'
                          ,boxLabel: _('resource_folder')
                          ,description: '<b>[[*isfolder]]</b><br />'+_('resource_folder_help')
              Severity: Major
              Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

                Function getMainLeftFields has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ,getMainLeftFields: function(config) {
                        config = config || {record:{}};
                        return [{
                            xtype: 'textfield'
                            ,fieldLabel: _('resource_pagetitle')+'<span class="required">*</span>'
                Severity: Major
                Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 hrs to fix

                  Function getSettingRightFields has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ,getSettingRightFields: function(config) {
                          return [{
                              xtype: 'xdatetime'
                              ,fieldLabel: _('resource_publishedon')
                              ,description: '<b>[[*publishedon]]</b><br />'+_('resource_publishedon_help')
                  Severity: Minor
                  Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

                    Function getSettingLeftFields has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        ,getSettingLeftFields: function(config) {
                            return [{
                                xtype: 'modx-field-parent-change'
                                ,fieldLabel: _('resource_parent')
                                ,description: '<b>[[*parent]]</b><br />'+_('resource_parent_help')
                    Severity: Minor
                    Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

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

                          ,success: function(o) {
                              this.warnUnsavedChanges = false;
                              var g = Ext.getCmp('modx-grid-resource-security');
                              if (g) { g.getStore().commitChanges(); }
                              var t = Ext.getCmp('modx-resource-tree');
                      Severity: Minor
                      Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

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

                        MODx.panel.Resource = function(config) {
                            config = config || {record:{}};
                            config.record = config.record || {};
                            Ext.applyIf(config,{
                                url: MODx.config.connector_url
                        Severity: Minor
                        Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

                          Function getSettingRightFieldsetRight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              ,getSettingRightFieldsetRight: function(config) {
                                  return [{
                                      xtype: 'xcheckbox'
                                      ,boxLabel: _('resource_cacheable')
                                      ,description: '<b>[[*cacheable]]</b><br />'+_('resource_cacheable_help')
                          Severity: Minor
                          Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

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

                                ,getSettingFields: function(config) {
                                    config = config || {record:{}};
                            
                                    var s = [{
                                        layout:'column'
                            Severity: Minor
                            Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

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

                                  ,getSettingRightFieldset: function(config) {
                                      return [{
                                          layout: 'column'
                                          ,id: 'modx-page-settings-box-columns'
                                          ,border: false
                              Severity: Minor
                              Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 1 hr to fix

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

                                    ,beforeSubmit: function(o) {
                                        var ta = Ext.get('ta');
                                        if (ta) {
                                            var v = ta.dom.value;
                                            var hc = Ext.getCmp('hiddenContent');
                                Severity: Minor
                                Found in manager/assets/modext/widgets/resource/modx.panel.resource.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

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

                                        },{
                                            xtype: MODx.config.publish_document ? 'xdatetime' : 'hidden'
                                            ,fieldLabel: _('resource_publishdate')
                                            ,description: '<b>[[*pub_date]]</b><br />'+_('resource_publishdate_help')
                                            ,name: 'pub_date'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 747..761

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

                                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: MODx.config.publish_document ? 'xdatetime' : 'hidden'
                                            ,fieldLabel: _('resource_unpublishdate')
                                            ,description: '<b>[[*unpub_date]]</b><br />'+_('resource_unpublishdate_help')
                                            ,name: 'unpub_date'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 733..747

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

                                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

                                        return [{
                                            xtype: 'xcheckbox'
                                            ,boxLabel: _('resource_folder')
                                            ,description: '<b>[[*isfolder]]</b><br />'+_('resource_folder_help')
                                            ,hideLabel: true
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 815..824

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 70.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        },{
                                            xtype: 'xcheckbox'
                                            ,boxLabel: _('resource_alias_visible')
                                            ,description: '<b>[[*alias_visible]]</b><br />'+_('resource_alias_visible_help')
                                            ,hideLabel: true
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 797..806

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 70.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        },{
                                            xtype: 'textfield'
                                            ,fieldLabel: _('resource_menutitle')
                                            ,description: '<b>[[*menutitle]]</b><br />'+_('resource_menutitle_help')
                                            ,name: 'menutitle'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 528..537
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 609..618

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

                                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: _('resource_summary')
                                            ,description: '<b>[[*introtext]]</b><br />'+_('resource_summary_help')
                                            ,name: 'introtext'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 537..547

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

                                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: 'xcheckbox'
                                            ,boxLabel: _('resource_richtext')
                                            ,description: '<b>[[*richtext]]</b><br />'+_('resource_richtext_help')
                                            ,hideLabel: true
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 806..815
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 857..867

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

                                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: 'xcheckbox'
                                            ,boxLabel: _('resource_searchable')
                                            ,description: '<b>[[*searchable]]</b><br />'+_('resource_searchable_help')
                                            ,hideLabel: true
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 824..833
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 857..867

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

                                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

                                        return [{
                                            xtype: 'xcheckbox'
                                            ,boxLabel: _('resource_cacheable')
                                            ,description: '<b>[[*cacheable]]</b><br />'+_('resource_cacheable_help')
                                            ,hideLabel: true
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 806..815
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 824..833

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

                                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: _('resource_description')
                                            ,description: '<b>[[*description]]</b><br />'+_('resource_description_help')
                                            ,name: 'description'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 547..556

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

                                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: 'textfield'
                                            ,fieldLabel: _('resource_link_attributes')
                                            ,description: '<b>[[*link_attributes]]</b><br />'+_('resource_link_attributes_help')
                                            ,name: 'link_attributes'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 528..537
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 600..609

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

                                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: 'textfield'
                                            ,fieldLabel: _('resource_longtitle')
                                            ,description: '<b>[[*longtitle]]</b><br />'+_('resource_longtitle_help')
                                            ,name: 'longtitle'
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 600..609
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 609..618

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

                                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

                                            ,items: [{
                                                columnWidth: .5
                                                ,id: 'modx-page-settings-right-box-left'
                                                ,items: this.getSettingRightFieldsetLeft(config)
                                            },{
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 657..665

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

                                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

                                            ,items:[{
                                                columnWidth: .5
                                                ,id: 'modx-page-settings-left'
                                                ,items: this.getSettingLeftFields(config)
                                            },{
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 784..792

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

                                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

                                    ,getPageHeader: function(config) {
                                        config = config || {record:{}};
                                        return {
                                            html: _('document_new')
                                            ,id: 'modx-resource-header'
                                Severity: Minor
                                Found in manager/assets/modext/widgets/resource/modx.panel.resource.js and 1 other location - About 50 mins to fix
                                manager/assets/modext/widgets/resource/modx.panel.resource.static.js on lines 22..29

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 52.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                            ,defaults: {
                                                layout: 'form'
                                                ,labelAlign: 'top'
                                                ,labelSeparator: ''
                                                ,border: false
                                Severity: Minor
                                Found in manager/assets/modext/widgets/resource/modx.panel.resource.js and 2 other locations - About 35 mins to fix
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 423..433
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 646..656

                                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

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

                                            ,defaults: {
                                                layout: 'form'
                                                ,labelAlign: 'top'
                                                ,labelSeparator: ''
                                                ,border: false
                                Severity: Minor
                                Found in manager/assets/modext/widgets/resource/modx.panel.resource.js and 2 other locations - About 35 mins to fix
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 423..433
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 773..783

                                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

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

                                            ,defaults: {
                                                layout: 'form'
                                                ,labelAlign: 'top'
                                                ,labelSeparator: ''
                                                ,border: false
                                Severity: Minor
                                Found in manager/assets/modext/widgets/resource/modx.panel.resource.js and 2 other locations - About 35 mins to fix
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 646..656
                                manager/assets/modext/widgets/resource/modx.panel.resource.js on lines 773..783

                                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

                                There are no issues that match your filters.

                                Category
                                Status