Location
has 29 functions (exceeds 20 allowed). Consider refactoring. Wontfix
export class Location<T> {
protected readonly _node: T;
protected readonly _ops: ZipperOps<T>;
protected readonly _path: Maybe<Path<T>>;
- Create a ticketCreate a ticket
File zipper.ts
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
import type { FnO, Maybe } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays/peek";
import { isArray } from "@thi.ng/checks/is-array";
import { assert } from "@thi.ng/errors/assert";
import type { Path, ZipperOps } from "./api.js";
- Create a ticketCreate a ticket
Function remove
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Wontfix
remove() {
this.ensureNotRoot();
const path = this._path!;
const lefts = path.l;
if (lefts ? lefts.length : 0) {
- Read upRead up
- Create a ticketCreate a ticket
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 next
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Wontfix
get next(): Maybe<Location<T>> {
if (this.isBranch) return this.down;
let right = this.right;
if (right) return right;
// eslint-disable-next-line no-this-alias -- zipper traversal
- Read upRead up
- Create a ticketCreate a ticket
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 prev
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Wontfix
get prev(): Maybe<Location<T>> {
let node = this.left;
if (!node) return this.up;
while (true) {
const child: Maybe<Location<T>> = node!.isBranch
- Read upRead up
- Create a ticketCreate a ticket
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"