thi-ng/umbrella

View on GitHub

Showing 333 of 1,883 total issues

Function createTree has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const createTree = <T>(
    opts: Partial<HDOMOpts>,
    impl: HDOMImplementation<T>,
    parent: T,
    tree: any,
Severity: Minor
Found in packages/hdom/src/dom.ts - About 2 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

File api.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { Fn, Predicate } from "@thi.ng/api";
import type {
    Attribs,
    FormAttribs,
    InputAttribs,
Severity: Minor
Found in packages/rdom-forms/src/api.ts - About 2 hrs to fix

Function sidechain has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export async function* sidechain<T>(
    src: AsyncIterable<T>,
    side: AsyncIterable<any>,
    opts?: Partial<SidechainOpts>
) {
Severity: Minor
Found in packages/transducers-async/src/sidechain.ts - About 2 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 smoothTangents has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export const smoothTangents = (
    pts: ReadonlyVec[],
    close = false,
    proportional = true,
    scale = 1
Severity: Minor
Found in packages/geom-poly-utils/src/tangent.ts - About 2 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 __makeField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const __makeField = (
    field: Field,
    obj: any,
    dv: DataView,
    bitOffset: number,
Severity: Minor
Found in packages/unionstruct/src/index.ts - About 2 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 classifyField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export const classifyField = (
    field: Pick<Field, "type" | "tag" | "len" | "const" | "sentinel" | "pad">,
    coll: TypeColl
): { classifier: FieldClass; isConst: boolean } => {
    if (isPadding(field)) return { classifier: "pad", isConst: false };
Severity: Minor
Found in packages/wasm-api-bindgen/src/internal/classify.ts - About 2 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 __expandVar has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const __expandVar = async (
    { children }: ParseScope<string>,
    ctx: GeneratorContext
) => {
    const id = __resolveVarName(children![0].result, ctx);
Severity: Minor
Found in packages/proctext/src/generate.ts - About 2 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

File api.ts has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type {
    Fn,
    Fn3,
    IObjectOf,
    Keys,
Severity: Minor
Found in packages/imago/src/api.ts - About 2 hrs to fix

BitMatrix has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class BitMatrix implements IClear, ICopy<BitMatrix> {
    /** Backing byte array */
    data: Uint8Array;
    /** Number of bytes per row */
    stride: number;
Severity: Minor
Found in packages/bitfield/src/bitmatrix.ts - About 2 hrs to fix

BitField has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class BitField implements IClear, ICopy<BitField>, ILength {
    /** Backing byte array */
    data: Uint8Array;
    /** Field size in bits (always a multiple of 8) */
    n: number;
Severity: Minor
Found in packages/bitfield/src/bitfield.ts - About 2 hrs to fix

Transacted has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class Transacted<T> implements IAtom<T> {
    parent: IAtom<T>;
    current: Maybe<T>;
    protected id: string;
    protected isActive: boolean;
Severity: Minor
Found in packages/atom/src/transacted.ts - About 2 hrs to fix

Function kmeans has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const kmeans = <T extends ReadonlyVec>(
    k: number,
    samples: T[],
    opts?: Partial<KMeansOpts>
) => {
Severity: Minor
Found in packages/k-means/src/kmeans.ts - About 2 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 __partialRow has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function* __partialRow(
    {
        pred,
        queue,
        visited,
Severity: Minor
Found in packages/grid-iterators/src/flood-fill.ts - About 2 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 __points has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function* __points(
    pts: ReadonlyVec[],
    attribs?: Attribs,
    opts?: Partial<AsAxiDrawOpts>
): IterableIterator<DrawCommand> {
Severity: Minor
Found in packages/geom-axidraw/src/as-axidraw.ts - About 2 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 cliApp has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const cliApp = async <
    OPTS extends object,
    CTX extends CommandCtx<OPTS, OPTS>
>(
    config: CLIAppConfig<OPTS, CTX>
Severity: Minor
Found in packages/args/src/cli.ts - About 2 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 decodeBytes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const decodeBytes = (src: Uint8Array) => {
    const freq = new Uint32Array(FREQ).fill(1);
    const input = new BitInputStream(src);
    const nbits = input.length;
    const out = [];
Severity: Minor
Found in packages/range-coder/src/index.ts - About 2 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 __isComplexComponent has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const __isComplexComponent = (x: any) => {
    if (isPlainObject(x)) {
        for (const k in x) {
            if (__isComplexComponent((<any>x)[k])) return true;
        }
Severity: Minor
Found in packages/rdom/src/compile.ts - About 1 hr 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 __kernelLookup2d has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const __kernelLookup2d = (
    src: ArrayLike<number>,
    x: number,
    y: number,
    width: number,
Severity: Minor
Found in packages/transducers/src/convolve.ts - About 1 hr 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 delete has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    delete(prefix: K, val?: V) {
        const n = prefix.length;
        if (n < 1) return false;
        const path: MultiTrie<K, V>[] = [];
        const key: string[] = [];
Severity: Minor
Found in packages/trie/src/multi-trie.ts - About 1 hr 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 hasNeighborhood has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    hasNeighborhood<N extends INeighborhood<ReadonlyVec, T>>(
        neighborhood: N,
        opts: Partial<QueryNeighborhoodOpts> = {}
    ) {
        const { entries, indices, items, keyFn, tableSize } = this;
Severity: Minor
Found in packages/geom-accel/src/hash-grid.ts - About 1 hr 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