thi-ng/umbrella

View on GitHub

Showing 364 of 1,898 total issues

File easing.ts has 322 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { FnBody1 } from "@thi.ng/shader-ast";
import { F } from "@thi.ng/shader-ast/api/types";
import { ifThen, ternary } from "@thi.ng/shader-ast/ast/controlflow";
import { defn, ret } from "@thi.ng/shader-ast/ast/function";
import {
Severity: Minor
Found in packages/shader-ast-stdlib/src/math/easing.ts - About 3 hrs to fix

Function __serialize has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

const __serialize = (tree: any, ctx: any, state: SerializeState): string => {
    if (tree == null) return "";
    if (Array.isArray(tree)) {
        if (!tree.length) {
            return "";
Severity: Minor
Found in packages/hiccup-markdown/src/serialize.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

Function fillPoly has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export const fillPoly = <T extends any[] | TypedArray, P>(
    grid: IGrid2D<T, P>,
    pts: ArrayLike<number>[],
    val: P | Shader2D<P>
) => {
Severity: Minor
Found in packages/rasterize/src/poly.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 list has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

        list: (scope, ctx, acc) => {
            const children = scope.children![0].children!;
            const stack: any[][] = [
                [children[0].id === "ulitem" ? "ul" : "ol"],
            ];
Severity: Minor
Found in packages/hiccup-markdown/src/parse.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 utf8Length has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export const utf8Length = (str: string) => {
    const n = str.length;
    let len = 0;
    for (let i = 0; i < n; ++i) {
        let u = str.charCodeAt(i);
Severity: Minor
Found in packages/strings/src/utf8.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 drawInstanced has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

const drawInstanced = (gl: WebGLRenderingContext, spec: ModelSpec) => {
    const isGL2 = isGL2Context(gl);
    const ext = !isGL2 ? gl.getExtension("ANGLE_instanced_arrays") : undefined;
    if (!(isGL2 || ext)) {
        error("instancing not supported");
Severity: Minor
Found in packages/webgl/src/draw.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 defuzz has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

export const defuzz = <I extends LVarSet<string>, O extends LVarSet<string>>(
    ins: I,
    outs: O,
    rules: Rule<I, O>[],
    vals: Partial<Record<keyof I, number>>,
Severity: Minor
Found in packages/fuzzy/src/defuzz.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 update has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    async update(curr: T[]) {
        if (!curr) return;
        const { keyFn, items, ctor, cache, el: parent } = this;
        const currItems: KListItem[] = [];
        const currCache = new Map<NumOrString, KListItem>();
Severity: Minor
Found in packages/rdom/src/klist.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 computeDiff has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

export const computeDiff = (a: string, b: string) => {
    const edits = diffArray(
        a.split("\n"),
        b.split("\n"),
        "only-distance-linear"
Severity: Minor
Found in packages/hdiff/src/diff.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 fieldType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

export const fieldType = (
    f: Field,
    parent: Struct | Union | FuncPointer,
    coll: TypeColl,
    opts: CodeGenOpts
Severity: Minor
Found in packages/wasm-api-bindgen/src/zig.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 expand has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

export const expand = (
    acc: string[],
    parent: any[],
    rules: any[],
    opts: CSSOpts
Severity: Minor
Found in packages/hiccup-css/src/impl.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 normalizeChildren has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

const normalizeChildren = (
    norm: any[],
    nattribs: any,
    opts: Partial<HDOMOpts>,
    ctx: any,
Severity: Minor
Found in packages/hdom/src/normalize.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

File comp.ts has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { Fn, FnA, FnAny, FnAnyA } from "@thi.ng/api";
import { illegalArity } from "@thi.ng/errors/illegal-arity";

/**
 * Returns the right-to-left composition of given functions. I.e. when
Severity: Minor
Found in packages/compose/src/comp.ts - About 2 hrs to fix

Function floydRivest has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export function floydRivest(
    buf: any[] | TypedArray,
    k = 1,
    cmp: Comparator<any> = compare,
    left = 0,
Severity: Minor
Found in packages/arrays/src/floyd-rivest.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 constructor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(...args: any[]) {
        let id, buf, tx, err;
        let [a, b] = args;
        switch (args.length) {
            case 0:
Severity: Minor
Found in packages/csp/src/channel.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 defKernel has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export const defKernel = (
    tpl: NumericArray | PoolTemplate,
    w: number,
    h: number,
    normalize = false
Severity: Minor
Found in packages/pixel/src/convolve.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 toEGFNode has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export const toEGFNode = (
    node: Node,
    prefix: Fn<string, string | undefined>,
    propFn: Fn2<string, any, string> = toEGFProp
) => {
Severity: Minor
Found in packages/egf/src/convert.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 diffTree has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export const diffTree = <T>(
    opts: Partial<HDOMOpts>,
    impl: HDOMImplementation<T>,
    parent: T,
    prev: any[],
Severity: Minor
Found in packages/hdom/src/diff.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 ops.ts has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { IObjectOf } from "@thi.ng/api";
import { isNumber } from "@thi.ng/checks/is-number";
import type { Assign, Op1, Op2, Sym, Term } from "../api/nodes.js";
import type { ComparisonOperator, Operator } from "../api/ops.js";
import type {
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts - About 2 hrs to fix
Severity
Category
Status
Source
Language