Function _cmp
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
_cmp(a, b) {
if (a === undefined) {
return b === undefined ? 0 : -1;
}
- 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 _cmp
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
_cmp(a, b) {
if (a === undefined) {
return b === undefined ? 0 : -1;
}
Function _type
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_type(v) {
if (typeof v === 'number') {
return 1;
}
Function _type
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
_type(v) {
if (typeof v === 'number') {
return 1;
}
- 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 _compileSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_compileSelector(selector) {
// you can pass a literal function instead of a selector
if (selector instanceof Function) {
this._isSimple = false;
this._selector = selector;
- 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
return 7;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return a.length - b.length;
Avoid too many return
statements within this function. Open
return i === b.length ? 0 : -1;
Avoid too many return
statements within this function. Open
return 9;
Avoid too many return
statements within this function. Open
return b ? 0 : 1;
Avoid too many return
statements within this function. Open
return 10;
Avoid too many return
statements within this function. Open
return 13;
Avoid too many return
statements within this function. Open
return a - b;
Avoid too many return
statements within this function. Open
return 5;
Avoid too many return
statements within this function. Open
return LocalCollection._f._cmp(toArray(a), toArray(b));
Avoid too many return
statements within this function. Open
return s;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return a < b ? -1 : a === b ? 0 : 1;
Avoid too many return
statements within this function. Open
return 1;
Avoid too many return
statements within this function. Open
return 3;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return b ? -1 : 0;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return 11;