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,
- Read upRead up
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',
- Read upRead up
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',
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',
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,
Function setValue
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
setValue: function(valueInit)
{
if(typeof valueInit == 'undefined') return;
var me = this,
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);
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
},
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)
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
- Read upRead up
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) {
Function processEvent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
processEvent: function(type, view, cell, recordIndex, cellIndex, e) {
Function onDblClick
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
onDblClick: function(view, cell, rowIdx, cellIndex, e) {
Function renderer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
renderer: function(value, metadata, record, rowIdx, colIdx) {
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,
- Read upRead up
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) {
- Read upRead up
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"