menglifang/task-manager

View on GitHub

Showing 17 of 47 total issues

Function selectionchange has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

      selectionchange: function (dataViewModel, selections, options) {
        var me = dataViewModel,combo = Ext.getCmp(me.view.checkboxComboId), 
        storeRecs, recs = [], d, i, j, nChecked, vField, dField, allState, allNodes, allItem, 
        grayCls = "ux-checkboxcombolist-tri",
        somethingChecked = me.view.somethingChecked,
Severity: Minor
Found in app/assets/javascripts/task-manager/extjs/lib/ux/CheckboxListCombo.js - About 5 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 initComponent has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    initComponent: function() 
    {
        var    me = this;
        
        me.tree = Ext.create('Ext.tree.Panel',
Severity: Minor
Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.js - About 5 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 initComponent has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initComponent: function() 
    {
        var    me = this;
        
        me.tree = Ext.create('Ext.tree.Panel',
Severity: Major
Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.js - About 2 hrs to fix

    File Form.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Ext.define('TM.view.plan.Form', {
      extend: 'Ext.form.Panel',
      xtype: 'plan_form',
    
      defaultPlanType: 'yearly',
    Severity: Minor
    Found in app/assets/javascripts/task-manager/extjs/app/view/plan/Form.js - About 2 hrs to fix

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

            selectionchange: function (dataViewModel, selections, options) {
              var me = dataViewModel,combo = Ext.getCmp(me.view.checkboxComboId), 
              storeRecs, recs = [], d, i, j, nChecked, vField, dField, allState, allNodes, allItem, 
              grayCls = "ux-checkboxcombolist-tri",
              somethingChecked = me.view.somethingChecked,
      Severity: Major
      Found in app/assets/javascripts/task-manager/extjs/lib/ux/CheckboxListCombo.js - About 2 hrs to fix

        Function setValue has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setValue: function(valueInit)
            {
                if(typeof valueInit == 'undefined') return;
                
                var    me = this,
        Severity: Minor
        Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.js - About 1 hr to fix

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

                          itemclick: function(view, record, item, index, e, eOpts)
                          {
                              var values = [];
                              
                              var node = me.tree.getRootNode().findChild('id', record.get(me.valueField), true);
          Severity: Minor
          Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.js - About 1 hr to fix

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

              init: function() {
                this.control({
                  'plan_search button[action="query"]': {
                    click: this.onQueryClick
                  },
            Severity: Minor
            Found in app/assets/javascripts/task-manager/extjs/app/controller/Plans.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                        if (allNodes.length) {
                          allItem = Ext.get(allNodes[0]);
                          vField = combo.valueField;
                          dField = combo.displayField;
                          storeRecs = Ext.clone(me.store.getRange(0));

                Function itemclick has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                                itemclick: function(view, record, item, index, e, eOpts)
                Severity: Minor
                Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.js - About 45 mins to fix

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

                    getDisplayValue: function () {
                      this.displayList = this.displayTplData && this.displayTplData.length 
                      ? (this.briefDisplayTpl || this.displayTpl).apply(this.displayTplData)
                      : "";
                      var ttl = this.allSelected
                  Severity: Minor
                  Found in app/assets/javascripts/task-manager/extjs/lib/ux/CheckboxListCombo.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 (selections[j].data[vField] == d[vField]) {
                                    d.checked = true;
                                    if (i>0) {
                                      nChecked++;
                                    } else if (!combo.allSelectedTitle) {
                  Severity: Major
                  Found in app/assets/javascripts/task-manager/extjs/lib/ux/CheckboxListCombo.js - About 45 mins to fix

                    Function processEvent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                processEvent: function(type, view, cell, recordIndex, cellIndex, e) {
                    Severity: Minor
                    Found in app/assets/javascripts/task-manager/extjs/lib/ux/RowExpander.js - About 45 mins to fix

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

                          onDblClick: function(view, cell, rowIdx, cellIndex, e) {
                      Severity: Minor
                      Found in app/assets/javascripts/task-manager/extjs/lib/ux/RowExpander.js - About 35 mins to fix

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

                            renderer: function(value, metadata, record, rowIdx, colIdx) {
                        Severity: Minor
                        Found in app/assets/javascripts/task-manager/extjs/lib/ux/RowExpander.js - About 35 mins to fix

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

                              setValue: function(valueInit)
                              {
                                  if(typeof valueInit == 'undefined') return;
                                  
                                  var    me = this,
                          Severity: Minor
                          Found in app/assets/javascripts/task-manager/extjs/lib/ux/TreeCombo.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 bindView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              bindView: function() {
                                  var view = this.getCmp().getView(),
                                      viewEl;
                          
                                  if (!view.rendered) {
                          Severity: Minor
                          Found in app/assets/javascripts/task-manager/extjs/lib/ux/RowExpander.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

                          Severity
                          Category
                          Status
                          Source
                          Language