modxcms/revolution

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

Summary

Maintainability
F
3 wks
Test Coverage

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

Ext.namespace('MODx.grid');

MODx.grid.Grid = function(config) {
    config = config || {};
    this.config = config;
Severity: Major
Found in manager/assets/modext/widgets/core/modx.grid.js - About 2 days to fix

    Function _loadColumnModel has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        ,_loadColumnModel: function() {
            if (this.config.columns) {
                var c = this.config.columns;
                for (var i=0;i<c.length;i++) {
                    // if specifying custom editor/renderer
    Severity: Minor
    Found in manager/assets/modext/widgets/core/modx.grid.js - About 4 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 Grid has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    MODx.grid.Grid = function(config) {
        config = config || {};
        this.config = config;
        this._loadStore();
        this._loadColumnModel();
    Severity: Major
    Found in manager/assets/modext/widgets/core/modx.grid.js - About 4 hrs to fix

      Function Grid has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

      MODx.grid.Grid = function(config) {
          config = config || {};
          this.config = config;
          this._loadStore();
          this._loadColumnModel();
      Severity: Minor
      Found in manager/assets/modext/widgets/core/modx.grid.js - About 4 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 _loadColumnModel has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          ,_loadColumnModel: function() {
              if (this.config.columns) {
                  var c = this.config.columns;
                  for (var i=0;i<c.length;i++) {
                      if (typeof(c[i].editor) == 'string') {
      Severity: Minor
      Found in manager/assets/modext/widgets/core/modx.grid.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

      Consider simplifying this complex logical expression.
      Open

              if (this.config.grouping) {
                  this.store = new Ext.data.GroupingStore({
                      url: this.config.url
                      ,baseParams: this.config.baseParams || { action: this.config.action || 'getList'}
                      ,reader: new Ext.data.JsonReader({
      Severity: Critical
      Found in manager/assets/modext/widgets/core/modx.grid.js - About 2 hrs to fix

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

        Ext.extend(MODx.grid.Grid,Ext.grid.EditorGridPanel,{
            windows: {}
        
            ,onStoreException: function(dp,type,act,opt,resp){
                var r = Ext.decode(resp.responseText);
        Severity: Minor
        Found in manager/assets/modext/widgets/core/modx.grid.js - About 2 hrs to fix

          Function LocalGrid has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MODx.grid.LocalGrid = function(config) {
              config = config || {};
          
              if (config.grouping) {
                  Ext.applyIf(config,{
          Severity: Major
          Found in manager/assets/modext/widgets/core/modx.grid.js - About 2 hrs to fix

            Function LocalGrid has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            MODx.grid.LocalGrid = function(config) {
                config = config || {};
            
                if (config.grouping) {
                    Ext.applyIf(config,{
            Severity: Minor
            Found in manager/assets/modext/widgets/core/modx.grid.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 addContextMenuItem has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                ,addContextMenuItem: function(items) {
                    var l = items.length;
                    for(var i = 0; i < l; i++) {
                        var options = items[i];
            
            
            Severity: Minor
            Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

              Function _loadStore has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ,_loadStore: function() {
                      if (this.config.grouping) {
                          this.store = new Ext.data.GroupingStore({
                              url: this.config.url
                              ,baseParams: this.config.baseParams || { action: this.config.action || 'getList'}
              Severity: Minor
              Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

                Function addContextMenuItem has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ,addContextMenuItem: function(items) {
                        var l = items.length;
                        for(var i = 0; i < l; i++) {
                            var options = items[i];
                
                
                Severity: Minor
                Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

                  Function saveRecord has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ,saveRecord: function(e) {
                          e.record.data.menu = null;
                          var p = this.config.saveParams || {};
                          Ext.apply(e.record.data,p);
                          var d = Ext.util.JSON.encode(e.record.data);
                  Severity: Minor
                  Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (config.grouping) {
                                this.store = new Ext.data.GroupingStore({
                                    data: config.data || []
                                    ,reader: new Ext.data.ArrayReader({},config.fields || [])
                                    ,sortInfo: config.sortInfo || {
                    Severity: Critical
                    Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

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

                          ,_loadColumnModel: function() {
                              if (this.config.columns) {
                                  var c = this.config.columns;
                                  for (var i=0;i<c.length;i++) {
                                      // if specifying custom editor/renderer
                      Severity: Minor
                      Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

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

                            ,_loadColumnModel: function() {
                                if (this.config.columns) {
                                    var c = this.config.columns;
                                    for (var i=0;i<c.length;i++) {
                                        if (typeof(c[i].editor) == 'string') {
                        Severity: Minor
                        Found in manager/assets/modext/widgets/core/modx.grid.js - About 1 hr to fix

                          Function addContextMenuItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              ,addContextMenuItem: function(items) {
                                  var l = items.length;
                                  for(var i = 0; i < l; i++) {
                                      var options = items[i];
                          
                          
                          Severity: Minor
                          Found in manager/assets/modext/widgets/core/modx.grid.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 addContextMenuItem has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              ,addContextMenuItem: function(items) {
                                  var l = items.length;
                                  for(var i = 0; i < l; i++) {
                                      var options = items[i];
                          
                          
                          Severity: Minor
                          Found in manager/assets/modext/widgets/core/modx.grid.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 _loadStore has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              ,_loadStore: function() {
                                  if (this.config.grouping) {
                                      this.store = new Ext.data.GroupingStore({
                                          url: this.config.url
                                          ,baseParams: this.config.baseParams || { action: this.config.action || 'getList'}
                          Severity: Minor
                          Found in manager/assets/modext/widgets/core/modx.grid.js - About 55 mins to fix

                          Cognitive Complexity

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

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

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

                          Further reading

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

                              ,_showMenu: function(g,ri,e) {
                                  e.stopEvent();
                                  e.preventDefault();
                                  this.menu.record = this.getStore().getAt(ri).data;
                                  if (!this.getSelectionModel().isSelected(ri)) {
                          Severity: Minor
                          Found in manager/assets/modext/widgets/core/modx.grid.js - About 55 mins to fix

                          Cognitive Complexity

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

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

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

                          Further reading

                          Avoid deeply nested control flow statements.
                          Open

                                              } else if (c[i].editor.initialConfig.xtype === 'datefield') {
                                                  c[i].renderer = Ext.util.Format.dateRenderer(c[i].editor.initialConfig.format || 'Y-m-d');
                                              } else if (r === 'boolean') {
                                                  c[i].renderer = this.rendYesNo;
                                              } else if (r === 'password') {
                          Severity: Major
                          Found in manager/assets/modext/widgets/core/modx.grid.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (c[i].editor && c[i].editor.store && !c[i].editor.store.isLoaded && c[i].editor.config.mode != 'local') {
                                                        c[i].editor.store.load();
                                                        c[i].editor.store.isLoaded = true;
                                                    }
                            Severity: Major
                            Found in manager/assets/modext/widgets/core/modx.grid.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  } else if (c[i].editor.initialConfig.xtype === 'datefield') {
                                                      c[i].renderer = Ext.util.Format.dateRenderer(c[i].editor.initialConfig.format || 'Y-m-d');
                                                  } else if (r === 'boolean') {
                                                      c[i].renderer = this.rendYesNo;
                                                  } else if (r === 'password') {
                              Severity: Major
                              Found in manager/assets/modext/widgets/core/modx.grid.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (w === null) {
                                                                    location.href = s;
                                                                } else { w.dom.src = s; }
                                Severity: Major
                                Found in manager/assets/modext/widgets/core/modx.grid.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (c[i].editor && c[i].editor.store && !c[i].editor.store.isLoaded && c[i].editor.config.mode != 'local') {
                                                              c[i].editor.store.load();
                                                              c[i].editor.store.isLoaded = true;
                                                          }
                                  Severity: Major
                                  Found in manager/assets/modext/widgets/core/modx.grid.js - About 45 mins to fix

                                    Function onStoreException has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        ,onStoreException: function(dp,type,act,opt,resp){
                                    Severity: Minor
                                    Found in manager/assets/modext/widgets/core/modx.grid.js - About 35 mins to fix

                                      Function loadWindow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          ,loadWindow: function(btn,e,win,or) {
                                              var r = this.menu.record;
                                              if (!this.windows[win.xtype]) {
                                                  Ext.applyIf(win,{
                                                      scope: this
                                      Severity: Minor
                                      Found in manager/assets/modext/widgets/core/modx.grid.js - About 35 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 loadWindow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          ,loadWindow: function(btn,e,win,or) {
                                              var r = this.menu.record;
                                              if (!this.windows[win.xtype] || win.force) {
                                                  Ext.applyIf(win,{
                                                      record: win.blankValues ? {} : r
                                      Severity: Minor
                                      Found in manager/assets/modext/widgets/core/modx.grid.js - About 35 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 onAfterAutoSave has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          ,onAfterAutoSave: function(response) {
                                              if (!response.success && response.message === '') {
                                                  var msg = '';
                                                  if (response.data.length) {
                                                      // We get some data for specific field(s) error but not regular error message
                                      Severity: Minor
                                      Found in manager/assets/modext/widgets/core/modx.grid.js - About 35 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

                                      Avoid too many return statements within this function.
                                      Open

                                      Ext.grid.PropertyColumnModel=function(a,b){var g=Ext.grid,f=Ext.form;this.grid=a;g.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:'name',id:'name',menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:'value',id:'value',menuDisabled:true}]);this.store=b;var c=new f.Field({autoCreate:{tag:'select',children:[{tag:'option',value:'true',html:'true'},{tag:'option',value:'false',html:'false'}]},getValue:function(){return this.el.dom.value=='true'}});this.editors={'date':new g.GridEditor(new f.DateField({selectOnFocus:true})),'string':new g.GridEditor(new f.TextField({selectOnFocus:true})),'number':new g.GridEditor(new f.NumberField({selectOnFocus:true,style:'text-align:left;'})),'boolean':new g.GridEditor(c)};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)};Ext.extend(Ext.grid.PropertyColumnModel,Ext.grid.ColumnModel,{nameText:'Name',valueText:'Value',dateFormat:'m/j/Y',renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return a?'true':'false'},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(v){return this.getPropertyName(v)},renderCell:function(a){var b=a;if(Ext.isDate(a)){b=this.renderDate(a)}else if(typeof a=='boolean'){b=this.renderBool(a)}return Ext.util.Format.htmlEncode(b)},getPropertyName:function(a){var b=this.grid.propertyNames;return b&&b[a]?b[a]:a},getCellEditor:function(a,b){var p=this.store.getProperty(b),n=p.data.name,val=p.data.value;if(this.grid.customEditors[n]){return this.grid.customEditors[n]}if(Ext.isDate(val)){return this.editors.date}else if(typeof val=='number'){return this.editors.number}else if(typeof val=='boolean'){return this.editors['boolean']}else{return this.editors.string}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);for(var a in this.editors){Ext.destroy(a)}}});
                                      Severity: Major
                                      Found in manager/assets/modext/widgets/core/modx.grid.js - About 30 mins to fix

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

                                                            if (r === true) {
                                                                if (c[i].editor && c[i].editor.store && !c[i].editor.store.isLoaded && c[i].editor.config.mode != 'local') {
                                                                    c[i].editor.store.load();
                                                                    c[i].editor.store.isLoaded = true;
                                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 2 days to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 364..378

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

                                        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 (r === true) {
                                                                if (c[i].editor && c[i].editor.store && !c[i].editor.store.isLoaded && c[i].editor.config.mode != 'local') {
                                                                    c[i].editor.store.load();
                                                                    c[i].editor.store.isLoaded = true;
                                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 2 days to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 689..703

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,collapseAll: function() {
                                        
                                                var expander = this.findExpanderPlugin(this.config.plugins);
                                        
                                                if (!expander) {
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 7 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 838..861

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,collapseAll: function() {
                                        
                                                var expander = this.findExpanderPlugin(this.config.plugins);
                                        
                                                if (!expander) {
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 7 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 532..555

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,expandAll: function() {
                                        
                                                var expander = this.findExpanderPlugin(this.config.plugins);
                                        
                                                if (!expander) {
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 7 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 813..836

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,expandAll: function() {
                                        
                                                var expander = this.findExpanderPlugin(this.config.plugins);
                                        
                                                if (!expander) {
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 7 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 507..530

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

                                        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 (config.tbar) {
                                                for (var ix = 0;ix<config.tbar.length;ix++) {
                                                    var itm = config.tbar[ix];
                                                    if (itm.handler && typeof(itm.handler) == 'object' && itm.handler.xtype) {
                                                        itm.handler = this.loadWindow.createDelegate(this,[itm.handler],true);
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 5 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 593..601

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

                                        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 (config.tbar) {
                                                for (var i = 0;i<config.tbar.length;i++) {
                                                    var itm = config.tbar[i];
                                                    if (itm.handler && typeof(itm.handler) == 'object' && itm.handler.xtype) {
                                                        itm.handler = this.loadWindow.createDelegate(this,[itm.handler],true);
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 5 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 85..93

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

                                        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 (o.confirm) {
                                                                Ext.Msg.confirm('',o.confirm,function(e) {
                                                                    if (e == 'yes') {
                                                                        var a = Ext.urlEncode(o.params || {action: o.action});
                                                                        var s = '?id='+id+'&'+a;
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 5 hrs to fix
                                        manager/assets/modext/core/modx.view.js on lines 62..78

                                        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

                                            ,encodeModified: function() {
                                                var p = this.getStore().getModifiedRecords();
                                                var rs = {};
                                                for (var i=0;i<p.length;i++) {
                                                    rs[p[i].data[this.config.primaryKey || 'id']] = p[i].data;
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 4 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 498..505

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

                                        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

                                            ,encode: function() {
                                                var p = this.getStore().getRange();
                                                var rs = {};
                                                for (var i=0;i<p.length;i++) {
                                                    rs[p[i].data[this.config.primaryKey || 'id']] = p[i].data;
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 4 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 489..496

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,findExpanderPlugin: function (plugins) {
                                        
                                                if (Ext.isObject(plugins)) {
                                                    plugins = [plugins];
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 3 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 867..880

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,findExpanderPlugin: function (plugins) {
                                        
                                                if (Ext.isObject(plugins)) {
                                                    plugins = [plugins];
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 3 hrs to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 561..574

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                    Ext.applyIf(win,{
                                                        record: win.blankValues ? {} : r
                                                        ,grid: this
                                                        ,listeners: {
                                                            'success': {fn:win.success || this.refresh,scope:win.scope || this}
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 2 hrs to fix
                                        manager/assets/modext/widgets/core/modx.tree.column.js on lines 148..154

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

                                        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 (options.handler) {
                                                        h = eval(options.handler);
                                                        if (h && typeof(h) == 'object' && h.xtype) {
                                                            h = this.loadWindow.createDelegate(this,[h],true);
                                                        }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 395..416

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

                                                    if (options.handler) {
                                                        h = eval(options.handler);
                                                        if (h && typeof(h) == 'object' && h.xtype) {
                                                            h = this.loadWindow.createDelegate(this,[h],true);
                                                        }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 740..768

                                        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

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

                                                if (this.windows[win.xtype].setValues && win.blankValues !== true && r != undefined) {
                                                    this.windows[win.xtype].setValues(r);
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 218..220

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 66.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (this.windows[win.xtype].setValues && win.blankValues !== true && r != undefined) {
                                                    this.windows[win.xtype].setValues(r);
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 670..672

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 66.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if(this.fireEvent('beforecollapse', this, record, body, row.rowIndex) !== false){
                                                    this.state[record.id] = false;
                                                    Ext.fly(row).replaceClass('x-grid3-row-expanded', 'x-grid3-row-collapsed');
                                                    this.fireEvent('collapse', this, record, body, row.rowIndex);
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 1123..1127

                                        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

                                                if(this.beforeExpand(record, body, row.rowIndex)){
                                                    this.state[record.id] = true;
                                                    Ext.fly(row).replaceClass('x-grid3-row-collapsed', 'x-grid3-row-expanded');
                                                    this.fireEvent('expand', this, record, body, row.rowIndex);
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 1136..1140

                                        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

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

                                                            } else {
                                                                var act = Ext.urlEncode(o.params || {action: o.action});
                                                                location.href = '?id='+id+'&'+act;
                                                            }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 406..409

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,rendPassword: function(v) {
                                                var z = '';
                                                for (var i=0;i<v.length;i++) {
                                                    z = z+'*';
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 895..901

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                                    if (e == 'yes') {
                                                                        var act = Ext.urlEncode(o.params || {action: o.action});
                                                                        location.href = '?id='+id+'&'+act;
                                                                    }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 411..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 59.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            ,rendPassword: function(v) {
                                                var z = '';
                                                for (var i=0;i<v.length;i++) {
                                                    z = z+'*';
                                                }
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 431..437

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                        ,listeners:{
                                                            load: function(){
                                                                var cmp = Ext.getCmp('modx-content');
                                                                if(typeof cmp !== "undefined") {
                                                                    cmp.doLayout(); /* Fix layout bug with absolute positioning */
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 337..344

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 56.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                        ,listeners:{
                                                            load: function(){
                                                                var cmp = Ext.getCmp('modx-content');
                                                                if(typeof cmp !== "undefined") {
                                                                    cmp.doLayout(); /* Fix layout bug with absolute positioning */
                                        Severity: Major
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 1 hr to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 318..325

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 56.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (config.pagingItems) {
                                                    for (var i=0;i<config.pagingItems.length;i++) {
                                                        pgItms.push(config.pagingItems[i]);
                                                    }
                                                }
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 55 mins to fix
                                        manager/assets/modext/widgets/core/tree/modx.tree.js on lines 128..134

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                ,viewConfig: {
                                                    forceFit: true
                                                    ,enableRowBody: true
                                                    ,autoFill: true
                                                    ,showPreview: true
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 28..35

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

                                                        if (typeof(c[i].editor) == 'string') {
                                                            c[i].editor = eval(c[i].editor);
                                                        }
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 2 other locations - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 357..359
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 683..685

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

                                                        if (typeof(c[i].renderer) == 'string') {
                                                            c[i].renderer = eval(c[i].renderer);
                                                        }
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 2 other locations - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 680..682
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 683..685

                                        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

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

                                                    store: new Ext.data.SimpleStore({
                                                        fields: ['d','v']
                                                        ,data: [[_('yes'),true],[_('no'),false]]
                                                    })
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.combo.js on lines 208..211

                                        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

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

                                                ,viewConfig: {
                                                    forceFit: true
                                                    ,enableRowBody: true
                                                    ,autoFill: true
                                                    ,showPreview: true
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 612..619

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

                                                        if (typeof(c[i].renderer) == 'string') {
                                                            c[i].renderer = eval(c[i].renderer);
                                                        }
                                        Severity: Minor
                                        Found in manager/assets/modext/widgets/core/modx.grid.js and 2 other locations - About 40 mins to fix
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 357..359
                                        manager/assets/modext/widgets/core/modx.grid.js on lines 680..682

                                        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