thi-ng/umbrella

View on GitHub

Showing 333 of 1,891 total issues

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 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-convolve/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, Maybe<string>>,
    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

Function clipPolylinePoly has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export const clipPolylinePoly = (pts: ReadonlyVec[], poly: ReadonlyVec[]) => {
    let res: ReadonlyVec[][] = [];
    if (pts.length < 2) return res;
    let isAInside = pointInPolygon2(pts[0], poly);
    for (let i = 0, n = pts.length - 1; i < n; i++) {
Severity: Minor
Found in packages/geom-clip-line/src/clip-poly.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 encodeBytes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export const encodeBytes = (src: Uint8Array) => {
    const freq = new Uint32Array(FREQ).fill(1);
    const out = new BitOutputStream(Math.max(src.length >> 1, 1));
    const len = src.length;
    let total = FREQ;
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 plotLineChart has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export const plotLineChart = (
    canvas: Canvas,
    x: number,
    y: number,
    height: number,
Severity: Minor
Found in packages/text-canvas/src/plot.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 __extract has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const __extract = (pts: ReadonlyVec[], maxD: number, order: number) => {
    if (pts.length < 2) return { segments: [], points: pts };
    const $ = order ? (p: ReadonlyVec) => [p[1], p[0]] : (p: ReadonlyVec) => p;
    pts = pts.sort(comparator2(order, order ^ 1));
    const segments: VecPair[] = [];
Severity: Minor
Found in packages/geom-trace-bitmap/src/extract.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 __sizeOf has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const __sizeOf = (
    spec: Field[],
    union: boolean,
    doAlign: boolean,
    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 fromRAF has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export const fromRAF = (opts: Partial<FromRAFOpts> = {}) =>
    isNode()
        ? fromInterval(16, opts)
        : stream<number>((stream) => {
                let i = 0;
Severity: Minor
Found in packages/rstream/src/raf.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 setAttrib has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export const setAttrib = (el: Element, id: string, val: any, attribs?: any) => {
    implementsFunction(val, "deref") && (val = val.deref());
    if (id.startsWith("__")) return;
    const isListener = id[0] === "o" && id[1] === "n";
    if (isListener) {
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

Function draw has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

export const draw = (
    specs: ModelSpec | ModelSpec[],
    opts: Partial<DrawFlags> = {}
) => {
    const _specs = isArray(specs) ? specs : [specs];
Severity: Minor
Found in packages/webgl/src/draw.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 splice has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    splice(at: ConsCell<T> | number, del = 0, insert?: Iterable<T>): DCons<T> {
        let cell: Maybe<ConsCell<T>>;
        if (typeof at === "number") {
            if (at < 0) {
                at += this._length;
Severity: Minor
Found in packages/dcons/src/dcons.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

SortedSet has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

@__inspectable
export class SortedSet<T>
    extends Set<T>
    implements IEquivSet<T>, ICompare<Set<T>>, IReducible<T, any>
{
Severity: Minor
Found in packages/sorted-map/src/sorted-set.ts - About 2 hrs to fix

File target.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

import type { Fn } from "@thi.ng/api";
import { isBoolean } from "@thi.ng/checks/is-boolean";
import { isNumber } from "@thi.ng/checks/is-number";
import { unsupported } from "@thi.ng/errors/unsupported";
import type {
Severity: Minor
Found in packages/shader-ast-js/src/target.ts - About 2 hrs to fix

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

export const formatPath = (
    path: string,
    ctx: ImgProcCtx,
    spec: OutputSpec,
    buf: Buffer | TypedArray
Severity: Minor
Found in packages/imago/src/path.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 source has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const source = <T>(
    initial?: T,
    buffer: IReadWriteBuffer<Maybe<T>> | number = 1
) => {
    const queue = isNumber(buffer) ? fifo<Maybe<T>>(buffer) : buffer;
Severity: Minor
Found in packages/transducers-async/src/source.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 __fieldType has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const __fieldType = (
    f: Field,
    coll: TypeColl,
    opts: CodeGenOpts,
    prefix: string
Severity: Minor
Found in packages/wasm-api-bindgen/src/c11.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 __formatCond has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const __formatCond = (cond: any) => {
    if (isString(cond)) {
        return cond;
    }
    const acc = [];
Severity: Minor
Found in packages/hiccup-css/src/conditional.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 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

Severity
Category
Status
Source
Language