Function zip3
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const zip3 = (as, bs, cs) => {
const zip3_ = (as, bs, cs) => {
if (isList(as) === false) { return error.listError(as, zip3); }
if (isList(bs) === false) { return error.listError(bs, zip3); }
if (isList(cs) === false) { return error.listError(cs, zip3); }
- 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 zip
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const zip = (as, bs) => {
const zip_ = (as, bs) => {
if (isList(as) === false) { return error.listError(as, zip); }
if (isList(bs) === false) { return error.listError(bs, zip); }
if (isEmpty(as)) { return emptyList; }
- 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 zipWith3
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const zipWith3 = (f, as, bs, cs) => {
const zipWith3_ = (f, as, bs, cs) => {
if (isList(as) === false) { return error.listError(as, zipWith3); }
if (isList(bs) === false) { return error.listError(bs, zipWith3); }
if (isList(cs) === false) { return error.listError(cs, zipWith3); }
- 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 zipWith
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const zipWith = (f, as, bs) => {
const zipWith_ = (f, as, bs) => {
if (isList(as) === false) { return error.listError(as, zipWith); }
if (isList(bs) === false) { return error.listError(bs, zipWith); }
if (isEmpty(as) || isEmpty(bs)) { return emptyList; }
- 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 cons(tuple(x, y))(zip(xs)(ys));
Avoid too many return
statements within this function. Open
return cons(tuple(x, y, z))(zip3(xs, ys, zs));
Avoid too many return
statements within this function. Open
return cons(f(x, y, z))(zipWith3(f, xs, ys, zs));