modxcms/revolution

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

Summary

Maintainability
F
1 wk
Test Coverage

Function TV has 364 lines of code (exceeds 25 allowed). Consider refactoring.
Open

MODx.panel.TV = function(config) {
    config = config || {};
    config.record = config.record || {};
    config = MODx.setStaticElementsConfig(config, 'tv');
    Ext.applyIf(config,{
Severity: Major
Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 1 day to fix

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

    /**
     * Loads the TV panel
     *
     * @class MODx.panel.TV
     * @extends MODx.FormPanel
    Severity: Major
    Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 1 day to fix

      Function TV has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      MODx.panel.TV = function(config) {
          config = config || {};
          config.record = config.record || {};
          config = MODx.setStaticElementsConfig(config, 'tv');
          Ext.applyIf(config,{
      Severity: Minor
      Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function TVInputProperties has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      MODx.panel.TVInputProperties = function(config) {
          config = config || {};
          Ext.applyIf(config,{
              id: 'modx-panel-tv-input-properties'
              ,title: _('tv_input_options')
      Severity: Major
      Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 3 hrs to fix

        Function TVOutputProperties has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        MODx.panel.TVOutputProperties = function(config) {
            config = config || {};
            Ext.applyIf(config,{
                id: 'modx-panel-tv-output-properties'
                ,title: _('tv_output_options')
        Severity: Minor
        Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 2 hrs to fix

          Function toggleStaticFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              ,toggleStaticFile: function(cb) {
                  var flds = ['modx-tv-static-file','modx-tv-static-file-help','modx-tv-static-source','modx-tv-static-source-help'];
                  var fld,i;
                  if (cb.checked) {
                      for (i in flds) {
          Severity: Minor
          Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

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

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

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

            Cognitive Complexity

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

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

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

            Further reading

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

            MODx.panel.TVInputProperties = function(config) {
                config = config || {};
                Ext.applyIf(config,{
                    id: 'modx-panel-tv-input-properties'
                    ,title: _('tv_input_options')
            Severity: Minor
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

                ,success: function(r) {
                    Ext.getCmp('modx-grid-tv-template').getStore().commitChanges();
                    Ext.getCmp('modx-grid-tv-security').getStore().commitChanges();
                    Ext.getCmp('modx-grid-element-sources').getStore().commitChanges();
                    if (MODx.request.id) Ext.getCmp('modx-grid-element-properties').save();
            Severity: Minor
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 279.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 161.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 136.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 136.

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

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

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

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

            Refactorings

            Further Reading

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

                    try {
                        pu.update({
                            url: MODx.config.connector_url
                            ,method: 'GET'
                            ,params: {
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 685..697

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

            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

                    try {
                        pu.update({
                            url: MODx.config.connector_url
                            ,method: 'GET'
                            ,params: {
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 609..621

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

            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: _('tv_default')
                            ,description: MODx.expandHelp ? '' : _('tv_default_desc')
                            ,name: 'default_text'
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 549..563

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

            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: _('tv_elements')
                            ,description: MODx.expandHelp ? '' : _('tv_elements_desc')
                            ,name: 'els'
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 568..582

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

            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-grid-tv-template'
                            ,itemId: 'grid-template'
                            ,cls:'main-wrapper'
                            ,tv: config.tv
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 311..323

            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-grid-tv-security'
                            ,itemId: 'grid-access'
                            ,cls:'main-wrapper'
                            ,tv: config.tv
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 3 hrs to fix
            manager/assets/modext/widgets/element/modx.panel.tv.js on lines 286..298

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 72.

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

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

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

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

            Refactorings

            Further Reading

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

                                },{
                                    xtype: 'textarea'
                                    ,fieldLabel: _('description')
                                    ,description: MODx.expandHelp ? '' : _('tv_desc_description')
                                    ,name: 'description'
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 2 other locations - About 1 hr to fix
            manager/assets/modext/widgets/element/modx.panel.snippet.js on lines 94..103
            manager/assets/modext/widgets/element/modx.panel.template.js on lines 95..104

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 72.

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

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

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

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

            Refactorings

            Further Reading

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

                                },{
                                    xtype: 'xcheckbox'
                                    ,boxLabel: _('tv_lock')
                                    ,description: MODx.expandHelp ? '' : _('tv_lock_msg')
                                    ,name: 'locked'
            Severity: Major
            Found in manager/assets/modext/widgets/element/modx.panel.tv.js and 1 other location - About 1 hr to fix
            manager/assets/modext/widgets/element/modx.panel.template.js on lines 185..193

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 61.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 61.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 57.

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

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

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

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

            Refactorings

            Further Reading

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

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

            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