modxcms/revolution

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

Summary

Maintainability
D
3 days
Test Coverage

File modx.panel.property.set.js has 446 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @class MODx.panel.PropertySet
 * @extends MODx.Panel
 * @param {Object} config An object of config properties
 * @xtype modx-panel-property-sets
Severity: Minor
Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 6 hrs to fix

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

    MODx.panel.PropertySet = function(config) {
        config = config || {};
        Ext.applyIf(config,{
            id: 'modx-panel-property-sets'
            ,cls: 'container'
    Severity: Minor
    Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

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

          loadGrid: function(n,e) {
              var ar = n.id.split('_');
              if (ar[0] == 'ps') {
                  MODx.Ajax.request({
                      url: MODx.config.connector_url
      Severity: Minor
      Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

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

        MODx.window.AddElementToPropertySet = function(config) {
            config = config || {};
            Ext.applyIf(config,{
                title: _('propertyset_element_add')
                ,url: MODx.config.connector_url
        Severity: Minor
        Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

          Function CreatePropertySet has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MODx.window.CreatePropertySet = function(config) {
              config = config || {};
              Ext.applyIf(config,{
                  title: _('propertyset_create')
                  ,url: MODx.config.connector_url
          Severity: Minor
          Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

            Function PropertySetProperties has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            MODx.grid.PropertySetProperties = function(config) {
                config = config || {};
                Ext.applyIf(config,{
                    autoHeight: true
                    ,lockProperties: false
            Severity: Minor
            Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

              Function DuplicatePropertySet has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              MODx.window.DuplicatePropertySet = function(config) {
                  config = config || {};
                  Ext.applyIf(config,{
                      title: _('propertyset_duplicate')
                      ,url: MODx.config.connector_url
              Severity: Minor
              Found in manager/assets/modext/widgets/element/modx.panel.property.set.js - About 1 hr to fix

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

                        if (!this.winUpdateSet) {
                            this.winUpdateSet = MODx.load({
                                xtype: 'modx-window-property-set-update'
                                ,record: r
                                ,listeners: {
                manager/assets/modext/widgets/element/modx.panel.property.set.js on lines 202..213

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

                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.winDupeSet) {
                            this.winDupeSet = MODx.load({
                                xtype: 'modx-window-property-set-duplicate'
                                ,record: r
                                ,listeners: {
                manager/assets/modext/widgets/element/modx.panel.property.set.js on lines 221..232

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

                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-combo-elements'
                            ,fieldLabel: _('element')
                            ,name: 'element'
                            ,id: 'modx-combo-elements'
                manager/assets/modext/widgets/element/modx.panel.property.set.js on lines 320..329

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

                        },{
                            xtype: 'modx-combo-element-class'
                            ,fieldLabel: _('class_name')
                            ,name: 'element_class'
                            ,id: 'modx-combo-element-class'
                manager/assets/modext/widgets/element/modx.panel.property.set.js on lines 329..338

                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

                There are no issues that match your filters.

                Category
                Status