Showing 86 of 133 total issues
Function SETBIT
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
, SETBIT: function (key, offset, state) {
/*jshint -W018*/
offset = str2int(offset);
if (!(offset > - 1)) return BAD_BIT1;
state = str2int(state);
- 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 too many return
statements within this function. Open
Open
return [nextCursor, keys];
Avoid too many return
statements within this function. Open
Open
return 1;
Avoid too many return
statements within this function. Open
Open
return BAD_TYPE;
Avoid too many return
statements within this function. Open
Open
if (scoreFail) return BAD_SORT;
Avoid too many return
statements within this function. Open
Open
return out;
Avoid too many return
statements within this function. Open
Open
if (!this.EXISTS(key)) return null;
Avoid too many return
statements within this function. Open
Open
return this.LLEN(store);
Avoid too many return
statements within this function. Open
Open
return OK;
Avoid too many return
statements within this function. Open
Open
return BAD_ARGS;
Avoid too many return
statements within this function. Open
Open
return count;
Avoid too many return
statements within this function. Open
Open
return BAD_INT;
Avoid too many return
statements within this function. Open
Open
if (weights.map(str2float).some(function (w) { return w instanceof ERROR; })) return BAD_FLOAT;
Avoid too many return
statements within this function. Open
Open
if (args.length) return BAD_SYNTAX;
Avoid too many return
statements within this function. Open
Open
return x;
Avoid too many return
statements within this function. Open
Open
return this.zOpStore(union, key, keys, weights || null, aggregate || this.zsum);
Avoid too many return
statements within this function. Open
Open
return arr;
Avoid too many return
statements within this function. Open
Open
if (this.EXISTS(key)) return null;
Avoid too many return
statements within this function. Open
Open
if (typeof store !== 'string') return BAD_SYNTAX;
Avoid too many return
statements within this function. Open
Open
return OK;