Showing 167 of 296 total issues
Avoid deeply nested control flow statements. Open
if(disorder[0] == -1) {
disorder[1] = j;
}
Function _initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_initialize: function (opts) {//}, scope) {
var o = {
};
- 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
else if( a && b && b.constructor == Object ) {
$ergo.deepMerge(o[name], b);
}
else {
o[name] = $ergo.deepCopy(b);
Avoid deeply nested control flow statements. Open
if( this._groups[i][stt] ) {
g = i;
break;
}
Function _construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_construct: function(o) {
if(o.provider) {
var provider = o.provider;
- 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( typeof callback == 'string' ) {
var a = callback.split(':');
// callback = (a.length == 1) ? this[callback].bind(this, null) : this[a[0]]/*.rcurry(a[1])*/.bind(this, a[1]);
// action
var action = $ergo.alias('actions:'+a[0]) || this[a[0]];
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( !o[name] ) {
o[name] = b;
}
else if(j[0] == '!') {
// переписываем опцию
Function createWidgets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
createWidgets: function() {
// рендерим виджеты скоупа (включаем виджеты в скоуп)
for(var i in this.widgets) {
- 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 ergo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
$.fn.ergo = function(o) {
if(this.length > 0){
var widget = (this[0]._dom) ? this[0]._dom._widget : undefined;// this.data('ergo-widget');
if(widget) return widget;
if(!o) return undefined;
- 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( index <= item.data._id[0] ) {
return true;
}
Function show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
show: function() {
var effect = false;
// if( !this.children.isEmpty() || this.el.text() ) { // ?
- 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( action == null ) {
//TODO missed action
callback = this._missedAction.bind(this, callback);
}
else {
Avoid deeply nested control flow statements. Open
if(!(i in o) || (o[i] && o[i].constructor != Object)) o[i] = {};
Avoid deeply nested control flow statements. Open
if( _item ) {
_item._destroy();
_item = null;
}
Avoid deeply nested control flow statements. Open
else if( p && p.constructor == Array ) {//$.isArray(p) ){
// if(!(i in o) || !$.isArray(o[i])) o[i] = [];
if(!(i in o) || (o[i] && o[i].constructor != Array)) o[i] = [];
Ergo.deepMerge(o[i], p);
}
Avoid deeply nested control flow statements. Open
for(var i = 0; i < this._id.length; i++) {
var key = this._id[i];
if(key in v)
src[key] = v[key];
}
Avoid deeply nested control flow statements. Open
if(e)
e._id[0] = j
Avoid deeply nested control flow statements. Open
for(var i = 0; i < this._id.length; i++)
mv[this._id[i]] = v[this._id[i]];
Avoid deeply nested control flow statements. Open
for(var i = 0; i < this._id.length; i++) {
var key = this._id[i];
if(key in v)
src[key] = v[key];
}