modxcms/revolution

View on GitHub
manager/assets/modext/widgets/windows.js

Summary

Maintainability
F
2 wks
Test Coverage

File windows.js has 887 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Generates the Duplicate Resource window.
 *
 * @class MODx.window.DuplicateResource
 * @extends MODx.Window
Severity: Major
Found in manager/assets/modext/widgets/windows.js - About 2 days to fix

    Function QuickCreateTV has 95 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MODx.window.QuickCreateTV = function(config) {
        config = config || {};
        this.ident = config.ident || 'qtv'+Ext.id();
    
        Ext.applyIf(config,{
    Severity: Major
    Found in manager/assets/modext/widgets/windows.js - About 3 hrs to fix

      Function setStaticElementsPath has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          setStaticElementsPath: function(f) {
              if (this.config.record.static === true) {
                  var category = this.config.record.category;
      
                  if (typeof category !== 'number') {
      Severity: Minor
      Found in manager/assets/modext/widgets/windows.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 _loadForm has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _loadForm: function() {
              if (this.checkIfLoaded(this.config.record)) {
                  this.fp.getForm().baseParams = {
                      action: 'resource/updateduplicate'
                      ,prefixDuplicate: true
      Severity: Major
      Found in manager/assets/modext/widgets/windows.js - About 3 hrs to fix

        Function DuplicateElement has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        MODx.window.DuplicateElement = function(config) {
            config = config || {};
        
            this.ident = config.ident || 'dupeel-'+Ext.id();
            var flds = [{
        Severity: Major
        Found in manager/assets/modext/widgets/windows.js - About 2 hrs to fix

          Function DuplicateContext has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MODx.window.DuplicateContext = function(config) {
              config = config || {};
              this.ident = config.ident || 'dupctx'+Ext.id();
              Ext.Ajax.timeout = 0;
              Ext.applyIf(config,{
          Severity: Major
          Found in manager/assets/modext/widgets/windows.js - About 2 hrs to fix

            Function QuickCreatePlugin has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            MODx.window.QuickCreatePlugin = function(config) {
                config = config || {};
            
                Ext.applyIf(config,{
                    title: _('quick_create_plugin')
            Severity: Major
            Found in manager/assets/modext/widgets/windows.js - About 2 hrs to fix

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

              MODx.window.CreateNamespace = function(config) {
                  config = config || {};
                  var r = config.record;
                  this.ident = config.ident || 'cns'+Ext.id();
                  Ext.applyIf(config,{
              Severity: Minor
              Found in manager/assets/modext/widgets/windows.js - About 2 hrs to fix

                Function QuickCreateChunk has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                MODx.window.QuickCreateChunk = function(config) {
                    config = config || {};
                
                    Ext.applyIf(config,{
                        title: _('quick_create_chunk')
                Severity: Minor
                Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

                  Function QuickCreateSnippet has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  MODx.window.QuickCreateSnippet = function(config) {
                      config = config || {};
                  
                      Ext.applyIf(config,{
                          title: _('quick_create_snippet')
                  Severity: Minor
                  Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

                    Function QuickCreateTemplate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    MODx.window.QuickCreateTemplate = function(config) {
                        config = config || {};
                    
                        Ext.applyIf(config,{
                            title: _('quick_create_template')
                    Severity: Minor
                    Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

                      Function Login has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      MODx.window.Login = function(config) {
                          config = config || {};
                          this.ident = config.ident || 'dupctx'+Ext.id();
                          Ext.Ajax.timeout = 0;
                          Ext.applyIf(config,{
                      Severity: Minor
                      Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

                        Function setStaticElementsPath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            setStaticElementsPath: function(f) {
                                if (this.config.record.static === true) {
                                    var category = this.config.record.category;
                        
                                    if (typeof category !== 'number') {
                        Severity: Minor
                        Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

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

                          MODx.window.CreateCategory = function(config) {
                              config = config || {};
                              this.ident = config.ident || 'ccat'+Ext.id();
                              Ext.applyIf(config,{
                                  title: _('new_category')
                          Severity: Minor
                          Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

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

                            MODx.window.RenameCategory = function(config) {
                                config = config || {};
                                this.ident = config.ident || 'rencat-'+Ext.id();
                                Ext.applyIf(config,{
                                    title: _('category_rename')
                            Severity: Minor
                            Found in manager/assets/modext/widgets/windows.js - About 1 hr to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if (response.results[i].id === category) {
                                                                      category = response.results[i].name;
                                                                  }
                              Severity: Major
                              Found in manager/assets/modext/widgets/windows.js - About 45 mins to fix

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

                                    _loadForm: function() {
                                        if (this.checkIfLoaded(this.config.record)) {
                                            this.fp.getForm().baseParams = {
                                                action: 'resource/updateduplicate'
                                                ,prefixDuplicate: true
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.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 CreateNamespace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                MODx.window.CreateNamespace = function(config) {
                                    config = config || {};
                                    var r = config.record;
                                    this.ident = config.ident || 'cns'+Ext.id();
                                    Ext.applyIf(config,{
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.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 2 locations. Consider refactoring.
                                Open

                                MODx.window.QuickCreateTemplate = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_create_template')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 544..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 332.

                                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.QuickCreateSnippet = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_create_snippet')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 461..513

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

                                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

                                MODx.window.QuickUpdateChunk = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_update_chunk')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 517..539
                                manager/assets/modext/widgets/windows.js on lines 600..622
                                manager/assets/modext/widgets/windows.js on lines 692..714
                                manager/assets/modext/widgets/windows.js on lines 820..842

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

                                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

                                MODx.window.QuickUpdateSnippet = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_update_snippet')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 435..457
                                manager/assets/modext/widgets/windows.js on lines 517..539
                                manager/assets/modext/widgets/windows.js on lines 692..714
                                manager/assets/modext/widgets/windows.js on lines 820..842

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

                                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

                                MODx.window.QuickUpdatePlugin = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_update_plugin')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 435..457
                                manager/assets/modext/widgets/windows.js on lines 517..539
                                manager/assets/modext/widgets/windows.js on lines 600..622
                                manager/assets/modext/widgets/windows.js on lines 820..842

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

                                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

                                MODx.window.QuickUpdateTemplate = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_update_template')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 435..457
                                manager/assets/modext/widgets/windows.js on lines 600..622
                                manager/assets/modext/widgets/windows.js on lines 692..714
                                manager/assets/modext/widgets/windows.js on lines 820..842

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

                                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

                                MODx.window.QuickUpdateTV = function(config) {
                                    config = config || {};
                                
                                    Ext.applyIf(config,{
                                        title: _('quick_update_tv')
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 day to fix
                                manager/assets/modext/widgets/windows.js on lines 435..457
                                manager/assets/modext/widgets/windows.js on lines 517..539
                                manager/assets/modext/widgets/windows.js on lines 600..622
                                manager/assets/modext/widgets/windows.js on lines 692..714

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

                                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

                                                    } else {
                                                        this.fp.getForm().findField('modx-'+this.ident+'-preservealias').setValue(false).disable();
                                                        this.fp.getForm().findField('modx-'+this.ident+'-preservemenuindex').setValue(false).disable();
                                                    }
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 3 hrs to fix
                                manager/assets/modext/widgets/windows.js on lines 881..884

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

                                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 (checked) {
                                                        this.fp.getForm().findField('modx-'+this.ident+'-preservealias').setValue(true).enable();
                                                        this.fp.getForm().findField('modx-'+this.ident+'-preservemenuindex').setValue(true).enable();
                                                    } else {
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 3 hrs to fix
                                manager/assets/modext/widgets/windows.js on lines 884..887

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

                                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: 'textfield'
                                            ,fieldLabel: _('namespace_path')
                                            ,description: MODx.expandHelp ? '' : _('namespace_path_desc')
                                            ,name: 'path'
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 hr to fix
                                manager/assets/modext/widgets/core/modx.grid.settings.js on lines 570..577
                                manager/assets/modext/widgets/core/modx.grid.settings.js on lines 622..629
                                manager/assets/modext/widgets/security/modx.tree.user.group.js on lines 226..233
                                manager/assets/modext/widgets/windows.js on lines 344..351

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

                                        },{
                                            xtype: 'textfield'
                                            ,fieldLabel: _('namespace_assets_path')
                                            ,description: MODx.expandHelp ? '' : _('namespace_assets_path_desc')
                                            ,name: 'assets_path'
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 4 other locations - About 1 hr to fix
                                manager/assets/modext/widgets/core/modx.grid.settings.js on lines 570..577
                                manager/assets/modext/widgets/core/modx.grid.settings.js on lines 622..629
                                manager/assets/modext/widgets/security/modx.tree.user.group.js on lines 226..233
                                manager/assets/modext/widgets/windows.js on lines 331..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 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 2 locations. Consider refactoring.
                                Open

                                        },{
                                            xtype: 'checkbox'
                                            ,id: 'modx-'+this.ident+'-preservemenuindex'
                                            ,hideLabel: true
                                            ,boxLabel: _('preserve_menuindex') // Todo: add translation
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 1 hr to fix
                                manager/assets/modext/widgets/windows.js on lines 891..899

                                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: 'checkbox'
                                            ,id: 'modx-'+this.ident+'-preservealias'
                                            ,hideLabel: true
                                            ,boxLabel: _('preserve_alias') // Todo: add translation
                                Severity: Major
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 1 hr to fix
                                manager/assets/modext/widgets/windows.js on lines 899..907

                                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

                                        flds.push({
                                            xtype: 'textfield'
                                            ,fieldLabel: _('element_caption_new')
                                            ,name: 'caption'
                                            ,id: 'modx-'+this.ident+'-caption'
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 55 mins to fix
                                manager/assets/modext/widgets/windows.js on lines 163..170

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

                                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

                                        flds.push({
                                                xtype: 'textfield'
                                                ,fieldLabel: _('static_file')
                                                ,name: 'static_file'
                                                ,id: 'modx-'+this.ident+'-static_file'
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 55 mins to fix
                                manager/assets/modext/widgets/windows.js on lines 143..149

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

                                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: 'textfield'
                                            ,id: 'modx-'+this.ident+'-newkey'
                                            ,fieldLabel: _('new_key')
                                            ,name: 'newkey'
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 40 mins to fix
                                manager/assets/modext/widgets/windows.js on lines 30..37

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

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        items.push({
                                            xtype: 'textfield'
                                            ,id: 'modx-'+this.ident+'-name'
                                            ,fieldLabel: _('resource_name_new')
                                            ,name: 'name'
                                Severity: Minor
                                Found in manager/assets/modext/widgets/windows.js and 1 other location - About 40 mins to fix
                                manager/assets/modext/widgets/windows.js on lines 864..871

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

                                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