Showing 29 of 43 total issues
Function recurseDeep
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function recurseDeep(MAX, eq, li, lj, ri, rj) {
Function longestCommonPrefix
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function longestCommonPrefix(eq, ai, aj, bi, bj) {
Function StackEntry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function StackEntry(D, li, lj, ri, rj) {
Function Split
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function Split(k, xBegin, xEnd, distanceLeft, distance) {
Function longestCommonSuffix
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function longestCommonSuffix(eq, aj, ai, bj, bi) {
Function twoWayAlloc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export default function twoWayAlloc(MAX, li, lj, ri, rj) {
Function recurseDeep
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function recurseDeep(MAX, eq, li, lj, ri, rj) {
assert(MAX >= 1);
assert(lj - li + rj - ri >= MAX);
if (li === lj || ri === rj) {
assert(li < lj || ri < rj);
- 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
Open
return halfPerimeter <= MAX
? l0 === l1 || r0 === r1
? halfPerimeter
: method(halfPerimeter, eq, l0, l1, r0, r1).distance
: l0 === l1 || r0 === r1
Function recurseDeeperStep
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function recurseDeeperStep(B, stack, eq) {
assert(stack.length > 0);
const entry = stack.pop();
assert(entry instanceof StackEntry);
let MAX = entry.D;
- 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"