thi-ng/umbrella

View on GitHub

Showing 383 of 2,131 total issues

File tensor.ts has 676 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// SPDX-License-Identifier: Apache-2.0
import type { Maybe, NumericArray } from "@thi.ng/api";
import { swizzle } from "@thi.ng/arrays/swizzle";
import { isNumber } from "@thi.ng/checks/is-number";
import { equiv, equivArrayLike } from "@thi.ng/equiv";
Severity: Major
Found in packages/tensors/src/tensor.ts - About 1 day to fix

Function traceLines has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

export const traceLines = (
    opts: TraceOpts,
    order: Fn<GridIterOpts2D, Iterable<[number, number]>>,
    border: Predicate<[number, number]>,
    tx: PointTransform2D,
Severity: Minor
Found in packages/geom-trace-bitmap/src/trace.ts - About 6 hrs 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 deserialize has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

export const deserialize = (
    src: Uint8Array | ArrayBufferLike,
    start = 0,
    end = src.byteLength
) => {
Severity: Minor
Found in packages/msgpack/src/deserialize.ts - About 5 hrs 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 parseIPv6Address has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

export const parseIPv6Address = (addr: string) => {
    if (addr == "::") return [0, 0, 0, 0, 0, 0, 0, 0];
    if (addr == "::1") return [0, 0, 0, 0, 0, 0, 0, 1];
    const n = addr.length - 1;
    if (n > 38) invalidIPv6(addr);
Severity: Minor
Found in packages/server/src/utils/host.ts - About 5 hrs 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 defOpTT has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpTT = <T = number>(fn: FnU2<T>): TensorOpTT<T> => {
    type $OP = (out: ITensor<T>, a: ITensor<T>, b: ITensor<T>) => ITensor<T>;
    const f1: $OP = (out, a, b) => {
        !out && (out = a);
        const {
Severity: Minor
Found in packages/tensors/src/defoptt.ts - About 5 hrs 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 defOpTTT has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpTTT = <T = number>(fn: FnU3<T>): TensorOpTTT<T> => {
    type $OP = (
        out: ITensor<T>,
        a: ITensor<T>,
        b: ITensor<T>,
Severity: Minor
Found in packages/tensors/src/defopttt.ts - About 4 hrs 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 defOpTN has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpTN = <T = number>(fn: FnU2<T>) => {
    type $OP = (out: ITensor<T> | null, a: ITensor<T>, n: T) => ITensor<T>;
    const f1: $OP = (out, a, n) => {
        !out && (out = a);
        const {
Severity: Minor
Found in packages/tensors/src/defoptn.ts - About 4 hrs 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 defOpTNN has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpTNN = <T = number>(fn: FnU3<T>) => {
    type $OP = (out: ITensor<T>, a: ITensor<T>, n: T, m: T) => ITensor<T>;
    const f1: $OP = (out, a, n, m) => {
        !out && (out = a);
        const {
Severity: Minor
Found in packages/tensors/src/defoptnn.ts - About 4 hrs 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 defOpT has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpT = <T = number>(fn: Fn<T, T>) => {
    type $OP = (out: ITensor<T> | null, a: ITensor<T>) => ITensor<T>;
    const f1: $OP = (out, a) => {
        !out && (out = a);
        const {
Severity: Minor
Found in packages/tensors/src/defopt.ts - About 4 hrs 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 __findHoleBridge has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

const __findHoleBridge = (hole: Vertex, outer: Vertex): Nullable<Vertex> => {
    const { x: hx, y: hy } = hole;
    let v = outer;
    let qx = -Infinity;
    let px: number, py: number;
Severity: Minor
Found in packages/geom-tessellate/src/earcut-complex.ts - About 4 hrs 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 defOpRTT has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpRTT = <A = number, B = A>(
    rfn: (
        acc: B,
        adata: TensorData<A>,
        bdata: TensorData<A>,
Severity: Minor
Found in packages/tensors/src/defoprtt.ts - About 4 hrs 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 distanceTransform has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

export const distanceTransform = (
    {
        data: spix,
        size: [width, height],
        stride: [sx, sy],
Severity: Minor
Found in packages/distance-transform/src/transform.ts - About 4 hrs 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 defOpRT has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpRT = <A = number, B = A>(
    rfn: (acc: B, data: TensorData<A>, i: number) => B,
    init: Fn0<B>
) => {
    const f1: TensorOpRT<A, B> = (a) => {
Severity: Minor
Found in packages/tensors/src/defoprt.ts - About 4 hrs 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 defOpN has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

export const defOpN = <A = number, B = A>(fn: Fn<A, B>) => {
    type $OP = (out: ITensor<B>, n: A) => ITensor<B>;
    const f1: $OP = (out, a) => {
        const {
            data,
Severity: Minor
Found in packages/tensors/src/defopn.ts - About 4 hrs 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 outputProc has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

export const outputProc: Processor = async (spec, input, ctx) => {
    const opts = <OutputSpec>spec;
    const outDir = resolve(ctx.opts.outDir || ".");
    let output = input.clone();
    if (opts.blurhash) {
Severity: Minor
Found in packages/imago/src/ops/output.ts - About 4 hrs 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 el has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

        el: ({ children }, opts, acc) => {
            const [name, { children: $attribs }, body] = children!;
            if (opts.ignoreElements?.includes(name.result)) return;
            const attribs: any = {};
            const el: Element = [name.result, attribs];
Severity: Minor
Found in packages/hiccup-html-parse/src/index.ts - About 4 hrs 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 update has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    update(curr: T) {
        const {
            prev,
            flow,
            windowSize,
Severity: Minor
Found in packages/pixel-flow/src/index.ts - About 3 hrs 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 __readFloat has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

const __readFloat = (src: string, index: number) => {
    index = __skipWS(src, index);
    let signOk = true;
    let dotOk = true;
    let expOk = false;
Severity: Minor
Found in packages/geom/src/path-from-svg.ts - About 3 hrs 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 __sortLinked has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

const __sortLinked = (list: Nullable<Vertex>) => {
    let numMerges;
    let inSize = 1;

    do {
Severity: Minor
Found in packages/geom-tessellate/src/earcut-complex.ts - About 3 hrs 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 circle has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export const circle = (
    canvas: Canvas,
    cx: number,
    cy: number,
    r: number,
Severity: Minor
Found in packages/text-canvas/src/circle.ts - About 3 hrs 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