modxcms/revolution

View on GitHub
manager/assets/modext/widgets/source/modx.grid.source.properties.js

Summary

Maintainability
F
1 wk
Test Coverage

File modx.grid.source.properties.js has 580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

MODx.grid.SourceProperties = function(config) {
    config = config || {};
    this.exp = new Ext.grid.RowExpander({
        tpl : new Ext.Template(
            '<p class="modx-property-description"><i>{desc_trans}</i></p>'
Severity: Major
Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 1 day to fix

    Function SourceProperties has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MODx.grid.SourceProperties = function(config) {
        config = config || {};
        this.exp = new Ext.grid.RowExpander({
            tpl : new Ext.Template(
                '<p class="modx-property-description"><i>{desc_trans}</i></p>'
    Severity: Major
    Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 2 hrs to fix

      Function UpdateSourceProperty has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      MODx.window.UpdateSourceProperty = function(config) {
          config = config || {};
          Ext.applyIf(config,{
              title: _('property_update')
              ,id: 'modx-window-source-property-update'
      Severity: Major
      Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 2 hrs to fix

        Function CreateSourceProperty has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        MODx.window.CreateSourceProperty = function(config) {
            config = config || {};
            Ext.applyIf(config,{
                title: _('property_create')
                ,id: 'modx-window-source-property-create'
        Severity: Major
        Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 2 hrs to fix

          Function SourcePropertyOption has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MODx.grid.SourcePropertyOption = function(config) {
              config = config || {};
              Ext.applyIf(config,{
                  title: _('property_options')
                  ,id: 'modx-grid-source-property-options'
          Severity: Minor
          Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 1 hr to fix

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

                ,getMenu: function() {
                    var def = false;
            
                    var r = this.menu.record;
                    var m = []
            Severity: Minor
            Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 1 hr to fix

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

                  ,onShow: function() {
                      var g = Ext.getCmp('modx-uep-grid-source-property-options');
                      if (!g) return;
                      if (this.fp.getForm().findField('xtype').getValue() == 'list') {
                          g.show();
              Severity: Minor
              Found in manager/assets/modext/widgets/source/modx.grid.source.properties.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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  ,update: function(btn,e) {
                      this.loadWindow(btn,e,{
                          xtype: 'modx-window-source-property-update'
                          ,record: this.menu.record
                          ,listeners: {
              Severity: Minor
              Found in manager/assets/modext/widgets/source/modx.grid.source.properties.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

              Consider simplifying this complex logical expression.
              Open

                      if (t == 'combo-boolean') {
                          v = (v == '1' || v == 'true' || v == 1 || v == true || v == _('yes') || v == 'yes') ? 1 : 0;
                          fld.setValue(v);
                      }
              Severity: Major
              Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 40 mins to fix

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

                MODx.grid.SourcePropertyOption = function(config) {
                    config = config || {};
                    Ext.applyIf(config,{
                        title: _('property_options')
                        ,id: 'modx-grid-source-property-options'
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 538..569

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

                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

                Ext.extend(MODx.window.CreateSourceProperty,MODx.Window,{
                    submit: function() {
                        var v = this.fp.getForm().getValues();
                
                        var g = Ext.getCmp('modx-cep-grid-source-property-options');
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 720..746

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

                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

                Ext.extend(MODx.grid.SourcePropertyOption,MODx.grid.LocalGrid,{
                    create: function(btn,e) {
                        this.loadWindow(btn,e,{
                            xtype: 'modx-window-source-property-option-create'
                            ,listeners: {
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 570..596

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

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

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

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

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

                Refactorings

                Further Reading

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

                    ,removeMultiple: function(btn,e) {
                        var rows = this.getSelectionModel().getSelections();
                        var rids = [];
                        for (var i=0;i<rows.length;i=i+1) {
                            rids.push(rows[i].data.id);
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 423..436

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

                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

                MODx.window.CreateSourcePropertyOption = function(config) {
                    config = config || {};
                    Ext.applyIf(config,{
                        title: _('property_option_create')
                        ,id: 'modx-window-source-property-option-create'
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 930..953

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

                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

                    ,_showMenu: function(g,ri,e) {
                        var sm = this.getSelectionModel();
                        if (sm.getSelections().length > 1) {
                            e.stopEvent();
                            e.preventDefault();
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 469..484

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

                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

                Ext.extend(MODx.form.SourceValueField,Ext.form.TextField,{
                    checkValue: function(fld,nv,ov) {
                        var t = Ext.getCmp(this.config.xtypeField).getValue();
                        var v = fld.getValue();
                        if (t == 'combo-boolean') {
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 1023..1032

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

                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

                Ext.extend(MODx.window.CreateSourcePropertyOption,MODx.Window,{
                    submit: function() {
                        if (this.fp.getForm().isValid()) {
                            if (this.fireEvent('success',this.fp.getForm().getValues())) {
                                this.fp.getForm().reset();
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 954..965

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

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

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

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

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

                Refactorings

                Further Reading

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

                        if (rec) {
                            var opt = rec.data.options;
                            var opts = [];
                            for (var x in opt) {
                              if (opt.hasOwnProperty(x)) {
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 908..917

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

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

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

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

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

                Refactorings

                Further Reading

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

                    ,revertAll: function(btn,e) {
                        Ext.Msg.confirm(_('warning'),_('property_revert_all_confirm'),function(e) {
                            if (e == 'yes') {
                                this.getStore().loadData(this.defaultProperties);
                            }
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 415..421

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

                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

                        ,tools: [{
                            id: 'plus'
                            ,qtip: _('expand_all')
                            ,handler: this.expandAll
                            ,scope: this
                manager/assets/modext/widgets/core/modx.grid.settings.js on lines 161..172
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 158..169

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

                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

                    ,_renderName: function(v,md,rec,ri) {
                        switch (rec.data.overridden) {
                            case 1:
                                return '<span style="color: green;">'+v+'</span>'; break;
                            case 2:
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 208..217
                manager/assets/modext/workspace/lexicon/lexicon.grid.js on lines 192..201

                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

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

                        if (r.overridden != 1) {
                            m.push({
                                text: _('property_remove')
                                ,scope: this
                                ,handler: this.remove.createDelegate(this,[{
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 509..518

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

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

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

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

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

                Refactorings

                Further Reading

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

                        },{
                            header: _('value')
                            ,dataIndex: 'value'
                            ,id: 'value'
                            ,width: 250
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 89..96

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

                    ,onDirty: function() {
                        if (this.config.panel) {
                            Ext.getCmp(this.config.panel).fireEvent('fieldChange');
                        }
                    }
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 192..196

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

                        if (r.overridden) {
                            m.push({
                                text: _('property_revert')
                                ,scope: this
                                ,handler: this.revert
                manager/assets/modext/widgets/element/modx.grid.element.properties.js on lines 502..508

                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