thi-ng/umbrella

View on GitHub

Showing 365 of 1,902 total issues

Function blit2d has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    dest: any[],
    dpos: ArrayLike<number>,
    dsize: ArrayLike<number>,
    src: ArrayLike<any>,
    ssize: ArrayLike<number>,
Severity: Minor
Found in packages/arrays/src/blit.ts - About 45 mins to fix

Function sample2d has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const sample2d = (
    sdf: SDFn,
    { pos: [px, py], size: [width, height] }: AABBLike,
    [resX, resY]: ReadonlyVec,
    domain?: Fn<ReadonlyVec, Vec>,
Severity: Minor
Found in packages/geom-sdf/src/sample.ts - About 45 mins to fix

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 partitionSync has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function partitionSync<T>(...args: any[]): any {
    const iter = __iter(partitionSync, args, iterator);
    if (iter) return iter;

    const {
Severity: Minor
Found in packages/transducers/src/partition-sync.ts - About 45 mins to fix

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 permutations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function* permutations(...src: any[]): IterableIterator<any[]> {
    const n = src.length - 1;
    if (n < 0) {
        return;
    }
Severity: Minor
Found in packages/transducers/src/permutations.ts - About 45 mins to fix

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 deeply nested control flow statements.
Open

                        if (
                            neighborhood.includesPosition(
                                keyFn(items[entries[i]])
                            )
                        )
Severity: Major
Found in packages/geom-accel/src/hash-grid.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (this.children[i]) {
                        this.children[i].doQuery(p, r, max, acc, distFn);
                        j--;
                    }
Severity: Major
Found in packages/geom-accel/src/nd-quadtree-map.ts - About 45 mins to fix

Function complexComponent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const complexComponent = (tree: any[]): CompiledComponent => ({
    async mount(parent: ParentNode, index: NumOrElement = -1) {
        this.subs = [];
        const attribs = { ...tree[1] };
        walk((x, path) => {
Severity: Minor
Found in packages/rdom/src/compile.ts - About 45 mins to fix

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 toHiccup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    toHiccup() {
        const attribs = this.attribs;
        const acc: any[] = ["g", { fill: "none", ...attribs }];
        if (attribs && attribs.res) {
            const res = attribs.res - 1;
Severity: Minor
Found in packages/geom/src/api/bpatch.ts - About 45 mins to fix

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 deeply nested control flow statements.
Open

                    if (prevBorder) {
                        if (n > min) $record();
                        curr = [p];
                    } else {
                        if (n >= min) {
Severity: Major
Found in packages/geom-trace-bitmap/src/trace.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (yy >= 0 && yy < height && xx >= 0 && xx < width) {
                        data[yy * width + xx] += (err * weights[j]) >> shift;
                    }
Severity: Major
Found in packages/pixel-dither/src/dither.ts - About 45 mins to fix

Function set has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    set(key: K, val: V) {
        const $this = __private.get(this)!;
        const { cmp, p, rnd } = $this;
        let node: Maybe<Node<K, V>> = this.findNode(key);
        if (node.k !== undefined && cmp(node.k, key) === 0) {
Severity: Minor
Found in packages/associative/src/sorted-map.ts - About 45 mins to fix

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 fitAllIntoBounds2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const fitAllIntoBounds2 = (shapes: IShape[], dest: Rect) => {
    const sbraw = __collBounds(shapes, bounds);
    if (!sbraw) return;
    const src = new Rect(...sbraw);
    const sx = safeDiv(dest.size[0], src.size[0]);
Severity: Minor
Found in packages/geom/src/fit-into-bounds.ts - About 45 mins to fix

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 traceBitmap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const traceBitmap = (opts: TraceBitmapOpts) => {
    const mat = opts.mat;
    const { width, height } = opts.img;
    const lines: VecPair[] = [];
    const points: Vec[] = [];
Severity: Minor
Found in packages/geom-trace-bitmap/src/trace.ts - About 45 mins to fix

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 hilbert2d has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function* hilbert2d(opts: GridIterOpts2D) {
    const { cols, rows, tx } = __opts(opts);
    let hIndex = 0; // hilbert curve index
    let hOrder = 0; // hilbert curve order
    // fit to number of buckets
Severity: Minor
Found in packages/grid-iterators/src/hilbert.ts - About 45 mins to fix

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 deeply nested control flow statements.
Open

                    if (down) {
                        y++;
                        d++;
                        ny = 0;
                    } else {
Severity: Major
Found in packages/grid-iterators/src/zigzag-diagonal.ts - About 45 mins to fix

Function normalize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const normalize = (tag: any[]) => {
    let name = tag[0];
    let match: RegExpExecArray | null;
    const hasAttribs = isPlainObject(tag[1]);
    const attribs: any = hasAttribs ? { ...tag[1] } : {};
Severity: Minor
Found in packages/hiccup/src/normalize.ts - About 45 mins to fix

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 sort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    sort() {
        const sorted: T[] = [];
        const g = this.copy();
        let queue = new ArraySet(g.leaves());
        while (true) {
Severity: Minor
Found in packages/dgraph/src/index.ts - About 45 mins to fix

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 orderedDither has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const orderedDither = (
    img: IntBuffer,
    size: BayerSize | BayerMatrix,
    numColors: number | number[]
) => {
Severity: Minor
Found in packages/pixel-dither/src/ordered.ts - About 45 mins to fix

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 deeply nested control flow statements.
Open

                if (last) curr.push(p);
Severity: Major
Found in packages/geom-trace-bitmap/src/trace.ts - About 45 mins to fix

Function dialRaw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const dialRaw = (
    gui: IMGUI,
    id: string,
    x: number,
    y: number,
Severity: Minor
Found in packages/imgui/src/components/dial.ts - About 45 mins to fix

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

Severity
Category
Status
Source
Language