Showing 84 of 84 total issues
Function concat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const concat = xss => {
if (isList(xss)) {
if (isEmpty(xss)) { return emptyList; }
const x = head(xss);
const xs = tail(xss);
- 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 transpose
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const transpose = lss => {
if (isList(lss) === false) { return error.listError(lss, transpose); }
if (isEmpty(lss)) { return emptyList; }
const ls = head(lss);
const xss = tail(lss);
- 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 and
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const and = (a, b) => {
const and_ = (a, b) => {
if (typeof a !== `boolean`) { return error.typeError(a, and); }
if (typeof b !== `boolean`) { return error.typeError(b, and); }
if (a) { return b; }
- 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 compare
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static compare(a, b) {
if (this.isEq(a, b)) { return EQ; }
let i = 1;
while (i in a) {
if (a[i] < b[i]) { return LT; }
- 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"