Showing 11 of 13 total issues
Function arrayFrom
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayFrom(param, isNewRef) {
var toArray = function(iterable, start, end) {
if (!iterable || !iterable.length) {
return [];
}
- 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 arraySort
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function arraySort(array, direction, key, emptyFirst) {
// supports [number], [string], [{key: number}], [{key: string}], [[string]], [[number]]
if (!isArray(array)) {
return;
Function arrayFrom
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function arrayFrom(param, isNewRef) {
var toArray = function(iterable, start, end) {
if (!iterable || !iterable.length) {
return [];
}
Function arrayMax
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayMax(array, comparisonFn) {
var i = 0,
ln = array.length,
item,
max = array[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 arrayMin
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayMin(array, comparisonFn) {
var i = 0,
ln = array.length,
item,
min = array[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 arrayTo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayTo(param) {
if (isArray(param)) {
return param;
}
- 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 arrayRepeat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayRepeat(array, n=1, byIndex=false) {
if (typeof array === 'undefined') {
throw `Cannot repeat array of type 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 too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return emptyFirst ? 1 : -1;
Function objectApplyIf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function objectApplyIf(object, config) {
var property;
if (object) {
for (property in config) {
- 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 arrayReplace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function arrayReplace(array, index, removeCount, insert) {
if (insert && insert.length) {
if (index < array.length) {
array.splice.apply(array, [index, removeCount].concat(insert));
} else {
- 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"