Function _dataDiff
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
_dataDiff: function(created, deleted, updated) {
var o = this.options;
var filter = o.dynamicFilter ? o.dynamicFilter.bind(this) : null;
- 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 bind
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
bind: function(data, update, pivot) {
var o = this.options;
var self = this;
var w = 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 _dataDiff
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
_dataDiff: function(created, deleted, updated) {
var o = this.options;
var filter = o.dynamicFilter ? o.dynamicFilter.bind(this) : null;
Function bind
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
bind: function(data, update, pivot) {
var o = this.options;
var self = this;
var w = this;
File widget-data.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @lends Ergo.core.Widget.prototype
Function _rebind
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_rebind: function(update, diff, initial) {
var o = this.options;
var self = 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 _dataChanged
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_dataChanged: function(lazy, cascade, no_dynamic) {
// this.events.fire('refresh');//, e);
// если отключено каскадирование, то обновление не производим
- 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 _rebind
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_rebind: function(update, diff, initial) {
var o = this.options;
var self = this;
Function _dataChanged
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_dataChanged: function(lazy, cascade, no_dynamic) {
// this.events.fire('refresh');//, e);
// если отключено каскадирование, то обновление не производим
Avoid deeply nested control flow statements. Open
if( index <= item.data._id[0] ) {
return true;
}
Avoid deeply nested control flow statements. Open
if(index != _item._index+1) {
n_upd++;
// _item.unrender()
this.items.remove(_item);
this.items.add(_item, index);
Avoid deeply nested control flow statements. Open
if( _item ) {
_item._destroy();
_item = null;
}
Consider simplifying this complex logical expression. Open
if(!child._pivot && !(initial.data == child.data && child.options.dynamic) && (child.data != self.data || update === false || !child._static)) {//child.options.binding)) {
child._rebind(false, undefined, initial);
}