thi-ng/umbrella

View on GitHub

Showing 378 of 1,891 total issues

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

    (x: any): Type =>
        isNumber(x)
            ? Math.floor(x) !== x
                ? Type.FLOAT
                : Type.INT
Severity: Minor
Found in packages/bencode/src/encode.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

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
Severity
Category
Status
Source
Language