Showing 29 of 43 total issues
Function twoWayScan
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export default function twoWayScan(
MAX,
V,
centerF,
centerB,
- 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 twoWayScan
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function twoWayScan(
MAX,
V,
centerF,
centerB,
Function makeScan32
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export default function makeScan32(method) {
/**
* Returns distance, or -1 if distance > MAX.
* Undefined behavior if indices are not int32.
*
- 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 recurseDeep
has 41 lines of code (exceeds 25 allowed). Consider refactoring. 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);
Function recurseDeeperStep
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function recurseDeeperStep(B, stack, eq) {
assert(stack.length > 0);
const entry = stack.pop();
assert(entry instanceof StackEntry);
let MAX = entry.D;
Function recurse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function recurse(MAX, eq, li, lj, ri, rj) {
assert(MAX >= 0);
assert(lj - li + rj - ri > MAX);
if (li === lj || ri === rj) {
assert(lj - li > MAX || rj - ri > MAX);
Function oneWay
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function oneWay(MAX, eq, li, lj, ri, rj) {
assert(MAX > 0);
assert(MAX <= lj - li + rj - ri);
assert(li < lj);
assert(ri < rj);
Function twoWayScan
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
MAX,
V,
centerF,
centerB,
eq,
Function backwardExtend
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
cMin,
cMax,
cx,
V,
eq,
Function forwardExtend
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function forwardExtend(cMin, cMax, cx, V, eq, lj, rj) {
Function oneWayAlloc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function oneWayAlloc(MAX, li, lj, ri, rj, init) {
Function twoWayRealloc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function twoWayRealloc(B, MAX, li, lj, ri, rj) {
Function longestCommonSuffix
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function longestCommonSuffix(eq, aj, ai, bj, bi) {
assert(Number.isInteger(aj));
assert(Number.isInteger(ai) && ai >= 0);
assert(Number.isInteger(bj));
assert(Number.isInteger(bi) && bi >= 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 oneWay
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function oneWay(MAX, eq, li, lj, ri, rj) {
assert(MAX > 0);
assert(MAX <= lj - li + rj - ri);
assert(li < lj);
assert(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
Function recurse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function recurse(MAX, eq, li, lj, ri, rj) {
Function recurseDeep
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function recurseDeep(MAX, eq, li, lj, ri, rj) {
Function diff
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function diff(MAX, eq, li, lj, ri, rj) {
Function oneWay
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function oneWay(MAX, eq, li, lj, ri, rj) {
Avoid deeply nested control flow statements. Open
if (V[c] === V[(c + cBDcF) | 0]) {
// XEnd === V[centerB + k - Delta]
return new Split(
(c - cFmD0) | 0, // K + Delta0
longestCommonSuffix(eq, x, li, (x - ((c - cFmD0) | 0)) | 0, ri),
Function longestCommonPrefix
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function longestCommonPrefix(eq, ai, aj, bi, bj) {
assert(Number.isInteger(ai) && ai >= 0);
assert(Number.isInteger(aj));
assert(Number.isInteger(bi) && bi >= 0);
assert(Number.isInteger(bj));
- 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"