Showing 102 of 109 total issues
Function iterableCount
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function iterableCount(value, predicate) {
var count = 0;
if (!predicate) {
count = collectionCount(value);
- 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 forOf
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function forOf(source, action) {
var arr = asArray(source);
// fast array iteration
if (arr) {
- 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 quickSort
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
quickSort: function (map, left, right) {
do {
var i = left,
j = right,
x = map[i + ((j - i) >> 1)];
Consider simplifying this complex logical expression. Open
if (
(objA instanceof Date && objB instanceof Date) ||
(objA instanceof Number && objB instanceof Number) ||
(objA instanceof String && objB instanceof String) ||
(objA instanceof Boolean && objB instanceof Boolean)) {
Function insert
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert: function (key, value, add) {
var comparer = this.comparer,
hash = comparer.hash(key) & 0x7FFFFFFF,
bucket = hash % this.buckets.length,
slot = null,
Function getGrouping
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getGrouping: function (key, value, create) {
var comparer = this.comparer,
hash = comparer.hash(key) & 0x7FFFFFFF,
bucket = hash % this.buckets.length,
index = this.buckets[bucket],
- 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 isArrayLike
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function isArrayLike(obj) {
// - Array
// - String
//
// - Typed arrays:
- 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 remove
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
remove: function (value) {
var node;
if (value instanceof LinkedListNode) {
node = value;
- 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 singleOrDefaultIterator
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function singleOrDefaultIterator(source, predicate, defaultValue) {
assertNotNull(source);
predicate = predicate || trueFunction;
assertType(predicate, Function);
- 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 linq
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function linq(iterable) {
mixin(iterable, {
/**
* Returns an empty Iterable.
- 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 getGrouping
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
getGrouping: function (key, value, create) {
var comparer = this.comparer,
hash = comparer.hash(key) & 0x7FFFFFFF,
bucket = hash % this.buckets.length,
index = this.buckets[bucket],
Function compute31BitNumberHash
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function compute31BitNumberHash(val) {
var h = 0;
// integer number
if (val <= MAX_SAFE_INTEGER && val >= MIN_SAFE_INTEGER && val % 1 === 0) {
Function joinIterator
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function joinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
assertNotNull(inner);
assertType(outerKeySelector, Function);
assertType(innerKeySelector, Function);
assertType(resultSelector, Function);
Function selectManyIterator
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function selectManyIterator(source, collectionSelector, resultSelector) {
assertNotNull(source);
assertType(collectionSelector, Function);
if (resultSelector) {
assertType(resultSelector, Function);
Function singleOrDefaultIterator
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function singleOrDefaultIterator(source, predicate, defaultValue) {
assertNotNull(source);
predicate = predicate || trueFunction;
assertType(predicate, Function);
Function hash
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function hash(obj, strict) {
// null/undefined hash is 0
if (obj === null || obj === undefined) {
return 0;
}
Function equals
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function equals(objA, objB, strict) {
// Objects are identical
if (objA === objB) {
return true;
}
Function insert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
insert: function (key, value, add) {
var comparer = this.comparer,
hash = comparer.hash(key) & 0x7FFFFFFF,
bucket = hash % this.buckets.length,
slot = 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 compute31BitNumberHash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function compute31BitNumberHash(val) {
var h = 0;
// integer number
if (val <= MAX_SAFE_INTEGER && val >= MIN_SAFE_INTEGER && val % 1 === 0) {
- 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 elementAtIterator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function elementAtIterator(source, index) {
assertNotNull(source);
assertType(index, Number);
if (index < 0) {
- 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"