talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/grid/GridView.js

Summary

Maintainability
F
2 wks
Test Coverage

File GridView.js has 1504 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.3.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 4 days to fix

    GridView has 111 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.grid.GridView = Ext.extend(Ext.util.Observable, {
        /**
         * Override this function to apply custom CSS classes to rows during rendering.  You can also supply custom
         * parameters to the row template for the current row to customize how it is rendered using the <b>rowParams</b>
         * parameter.  This function should return the CSS class name (or empty string '' for none) that will be added
    Severity: Major
    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 days to fix

      Function handleHdMove has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          handleHdMove : function(e) {
              var header = this.findHeaderCell(this.activeHdRef);
              
              if (header && !this.headersDisabled) {
                  var handleWidth  = this.splitHandleWidth || 5,
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 handleMouseDown has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          handleMouseDown : function(e){
              var t = this.view.findHeaderCell(e.getTarget());
              if(t && this.allowHeaderDrag(e)){
                  var xy = this.view.fly(t).getXY(), 
                      x = xy[0],
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          processEvent : function(name, e) {
              var target = e.getTarget(),
                  grid   = this.grid,
                  header = this.findHeaderIndex(target),
                  row, cell, col, body;
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          doRender : function(columns, records, store, startRow, colCount, stripe) {
              var templates = this.templates,
                  cellTemplate = templates.cell,
                  rowTemplate = templates.row,
                  last = colCount - 1,
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function destroy has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          destroy : function() {
              var me              = this,
                  grid            = me.grid,
                  gridEl          = grid.getGridEl(),
                  dragZone        = me.dragZone,
      Severity: Major
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 3 hrs to fix

        Function insertRows has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            insertRows : function(dm, firstRow, lastRow, isUpdate) {
                var last = dm.getCount() - 1;
                if( !isUpdate && firstRow === 0 && lastRow >= last) {
                    this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
                        this.refresh();
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 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 refreshRow has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            refreshRow: function(record) {
                var store     = this.ds,
                    colCount  = this.cm.getColumnCount(),
                    columns   = this.getColumnData(),
                    last      = colCount - 1,
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 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 refreshRow has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            refreshRow: function(record) {
                var store     = this.ds,
                    colCount  = this.cm.getColumnCount(),
                    columns   = this.getColumnData(),
                    last      = colCount - 1,
        Severity: Major
        Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 hrs to fix

          Function afterRenderUI has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              afterRenderUI: function() {
                  var grid = this.grid;
                  
                  this.initElements();
          
          
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 hrs to fix

            Function fitColumns has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                fitColumns : function(preventRefresh, onlyExpand, omitColumn) {
                    var grid          = this.grid,
                        colModel      = this.cm,
                        totalColWidth = colModel.getTotalWidth(false),
                        gridWidth     = this.getGridInnerWidth(),
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 2 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 doRender has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                doRender : function(columns, records, store, startRow, colCount, stripe) {
                    var templates = this.templates,
                        cellTemplate = templates.cell,
                        rowTemplate = templates.row,
                        last = colCount - 1,
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

              Function initData has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initData : function(newStore, newColModel) {
                      var me = this;
                      
                      if (me.ds) {
                          var oldStore = me.ds;
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

                Function fitColumns has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fitColumns : function(preventRefresh, onlyExpand, omitColumn) {
                        var grid          = this.grid,
                            colModel      = this.cm,
                            totalColWidth = colModel.getTotalWidth(false),
                            gridWidth     = this.getGridInnerWidth(),
                Severity: Minor
                Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                      initTemplates : function() {
                          var templates = this.templates || {},
                              template, name,
                              
                              headerCellTpl = new Ext.Template(
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

                    Function layout has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        layout : function(initial) {
                            if (!this.mainBody) {
                                return; // not rendered
                            }
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 processRows has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        processRows : function(startRow, skipStripe) {
                            if (!this.ds || this.ds.getCount() < 1) {
                                return;
                            }
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 layout has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        layout : function(initial) {
                            if (!this.mainBody) {
                                return; // not rendered
                            }
                    
                    
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                          ensureVisible : function(row, col, hscroll) {
                              var resolved = this.resolveCell(row, col, hscroll);
                              
                              if (!resolved || !resolved.row) {
                                  return null;
                      Severity: Minor
                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                            handleMouseDown : function(e){
                                var t = this.view.findHeaderCell(e.getTarget());
                                if(t && this.allowHeaderDrag(e)){
                                    var xy = this.view.fly(t).getXY(), 
                                        x = xy[0],
                        Severity: Minor
                        Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                              renderHeaders : function() {
                                  var colModel   = this.cm,
                                      templates  = this.templates,
                                      headerTpl  = templates.hcell,
                                      properties = {},
                          Severity: Minor
                          Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                                renderHeaders : function() {
                                    var colModel   = this.cm,
                                        templates  = this.templates,
                                        headerTpl  = templates.hcell,
                                        properties = {},
                            Severity: Minor
                            Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 insertRows has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                insertRows : function(dm, firstRow, lastRow, isUpdate) {
                                    var last = dm.getCount() - 1;
                                    if( !isUpdate && firstRow === 0 && lastRow >= last) {
                                        this.fireEvent('beforerowsinserted', this, firstRow, lastRow);
                                            this.refresh();
                            Severity: Minor
                            Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                                  autoExpand : function(preventUpdate) {
                                      var grid             = this.grid,
                                          colModel         = this.cm,
                                          gridWidth        = this.getGridInnerWidth(),
                                          totalColumnWidth = colModel.getTotalWidth(false),
                              Severity: Minor
                              Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 processEvent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  processEvent : function(name, e) {
                                      var target = e.getTarget(),
                                          grid   = this.grid,
                                          header = this.findHeaderIndex(target),
                                          row, cell, col, body;
                              Severity: Minor
                              Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix

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

                                    ensureVisible : function(row, col, hscroll) {
                                        var resolved = this.resolveCell(row, col, hscroll);
                                        
                                        if (!resolved || !resolved.row) {
                                            return null;
                                Severity: Minor
                                Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 doRender has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    doRender : function(columns, records, store, startRow, colCount, stripe) {
                                Severity: Minor
                                Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 45 mins to fix

                                  Function resolveCell has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      resolveCell : function(row, col, hscroll) {
                                          if (!Ext.isNumber(row)) {
                                              row = row.rowIndex;
                                          }
                                          
                                  Severity: Minor
                                  Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 45 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (!col || (col.processEvent && (col.processEvent(name, e, grid, row, cell) !== false))) {
                                                              grid.fireEvent('row' + name, grid, row, e);
                                                          }
                                  Severity: Major
                                  Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if(ci+adjust < 0){
                                                                return;
                                                            }
                                    Severity: Major
                                    Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 45 mins to fix

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

                                          destroy : function() {
                                              var me              = this,
                                                  grid            = me.grid,
                                                  gridEl          = grid.getGridEl(),
                                                  dragZone        = me.dragZone,
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 updateAllColumnWidths has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          updateAllColumnWidths : function() {
                                              var totalWidth = this.getTotalWidth(),
                                                  colCount   = this.cm.getColumnCount(),
                                                  rows       = this.getRows(),
                                                  rowCount   = rows.length,
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 initTemplates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          initTemplates : function() {
                                              var templates = this.templates || {},
                                                  template, name,
                                                  
                                                  headerCellTpl = new Ext.Template(
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 afterRenderUI has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          afterRenderUI: function() {
                                              var grid = this.grid;
                                              
                                              this.initElements();
                                      
                                      
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.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 handleHdOver has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          handleHdOver : function(e, target) {
                                              var header = this.findHeaderCell(target);
                                              
                                              if (header && !this.headersDisabled) {
                                                  var fly = this.fly(header);
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 25 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          initData : function(newStore, newColModel) {
                                              var me = this;
                                              
                                              if (me.ds) {
                                                  var oldStore = me.ds;
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 25 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          getColumnData : function() {
                                              var columns  = [],
                                                  colModel = this.cm,
                                                  colCount = colModel.getColumnCount(),
                                                  fields   = this.ds.fields,
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 25 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          getColumnWidth : function(column) {
                                              var columnWidth = this.cm.getColumnWidth(column),
                                                  borderWidth = this.borderWidth;
                                              
                                              if (Ext.isNumber(columnWidth)) {
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 25 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          refresh : function(headersToo) {
                                              this.fireEvent('beforerefresh', this);
                                              this.grid.stopEditing(true);
                                      
                                              var result = this.renderBody();
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 6 hrs to fix
                                      app/assets/javascripts/ext/src/widgets/grid/PivotGridView.js on lines 314..328

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

                                      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 (Ext.isGecko) {
                                                  if (!this.scrollToTopTask) {
                                                      this.scrollToTopTask = new Ext.util.DelayedTask(this.scrollToTop, this);
                                                  }
                                                  this.scrollToTopTask.delay(1);
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/ext/src/widgets/form/RadioGroup.js on lines 93..98

                                      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

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

                                          onCellDeselect : function(row, col) {
                                              var cell = this.getCell(row, col);
                                              if (cell) {
                                                  this.fly(cell).removeClass('x-grid3-cell-selected');
                                              }
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 2152..2157

                                      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

                                          onCellSelect : function(row, col) {
                                              var cell = this.getCell(row, col);
                                              if (cell) {
                                                  this.fly(cell).addClass('x-grid3-cell-selected');
                                              }
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 1 hr to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 2160..2165

                                      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

                                          findRowBody : function(el) {
                                              if (!el) {
                                                  return false;
                                              }
                                              
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 55 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 526..531

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 53.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                  if (firstChild) {
                                                      firstChild.style.width = totalWidth;
                                                      firstChild.rows[0].childNodes[column].style.width = columnWidth;
                                                  }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 55 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 769..772

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 53.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                  if (rowFirstChild) {
                                                      rowFirstChild.style.width = totalWidth;
                                                      rowFirstChild.rows[0].childNodes[col].style.display = display;
                                                  }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 55 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 738..741

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 53.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                          findRow : function(el) {
                                              if (!el) {
                                                  return false;
                                              }
                                              return this.fly(el).findParent(this.rowSelector, this.rowSelectorDepth);
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 55 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 549..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 53.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                  if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') {
                                                      meta.css += ' x-grid3-dirty-cell';
                                                  }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 50 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 830..832

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 52.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                      if (this.markDirty && record.dirty && typeof record.modified[column.name] != 'undefined') {
                                                          meta.css += ' x-grid3-dirty-cell';
                                                      }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 50 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 1729..1731

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 52.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                              Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this, hd,
                                                  'gridSplitters' + this.grid.getGridEl().id, {
                                                  dragElId : Ext.id(this.proxy.dom), resizeFrame:false
                                              });
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 50 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/ColumnSplitDD.js on lines 16..19

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

                                      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

                                          addRowClass : function(rowId, cls) {
                                              var row = this.getRow(rowId);
                                              if (row) {
                                                  this.fly(row).addClass(cls);
                                              }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 45 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 598..603

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

                                      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

                                          removeRowClass : function(row, cls) {
                                              var r = this.getRow(row);
                                              if(r){
                                                  this.fly(r).removeClass(cls);
                                              }
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 1 other location - About 45 mins to fix
                                      app/assets/javascripts/ext/src/widgets/grid/GridView.js on lines 590..595

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

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                              this.mainHd.on({
                                                  scope    : this,
                                                  mouseover: this.handleHdOver,
                                                  mouseout : this.handleHdOut,
                                                  mousemove: this.handleHdMove
                                      Severity: Major
                                      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js and 3 other locations - About 40 mins to fix
                                      app/assets/javascripts/ext/src/widgets/LoadMask.js on lines 28..33
                                      app/assets/javascripts/ext/src/widgets/form/Combo.js on lines 721..726
                                      app/assets/javascripts/ext/src/widgets/form/CompositeField.js on lines 119..124

                                      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