thi-ng/umbrella

View on GitHub

Showing 378 of 1,891 total issues

Avoid deeply nested control flow statements.
Open

                    if (prevBorder) {
                        if (n > min) $record();
                        curr = [p];
                    } else {
                        if (n >= min) {
Severity: Major
Found in packages/geom-trace-bitmap/src/trace.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (down) {
                        y++;
                        d++;
                        ny = 0;
                    } else {
Severity: Major
Found in packages/grid-iterators/src/zigzag-diagonal.ts - About 45 mins to fix

Function __circleOpts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const __circleOpts = (
    opts: number | Partial<SamplingOpts>,
    r: number
): [number, number, boolean] =>
    isNumber(opts)
Severity: Minor
Found in packages/geom/src/internal/vertices.ts - About 45 mins 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 dialRaw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const dialRaw = (
    gui: IMGUI,
    id: string,
    x: number,
    y: number,
Severity: Minor
Found in packages/imgui/src/components/dial.ts - About 45 mins 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 normalize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const normalize = (tag: any[]) => {
    let name = tag[0];
    let match: RegExpExecArray | null;
    const hasAttribs = isPlainObject(tag[1]);
    const attribs: any = hasAttribs ? { ...tag[1] } : {};
Severity: Minor
Found in packages/hiccup/src/normalize.ts - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                    if (yy >= 0 && yy < height && xx >= 0 && xx < width) {
                        data[yy * width + xx] += (err * weights[j]) >> shift;
                    }
Severity: Major
Found in packages/pixel-dither/src/dither.ts - About 45 mins to fix

Function hilbert2d has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function* hilbert2d(opts: GridIterOpts2D) {
    const { cols, rows, tx } = __opts(opts);
    let hIndex = 0; // hilbert curve index
    let hOrder = 0; // hilbert curve order
    // fit to number of buckets
Severity: Minor
Found in packages/grid-iterators/src/hilbert.ts - About 45 mins 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 __ftransforms has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const __ftransforms = (attribs: Attribs) => {
    let v: any;
    if (
        (v = attribs.transform) ||
        attribs.translate ||
Severity: Minor
Found in packages/hiccup-svg/src/format.ts - About 45 mins 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 set has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    set(key: K, val: V) {
        const $this = __private.get(this)!;
        const { cmp, p, rnd } = $this;
        let node: Maybe<Node<K, V>> = this.findNode(key);
        if (node.k !== undefined && cmp(node.k, key) === 0) {
Severity: Minor
Found in packages/sorted-map/src/sorted-map.ts - About 45 mins 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 implementations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const implementations = (
    id: PropertyKey,
    rels: IObjectOf<MultiFn<any>[]>,
    ...impls: (MultiFn<any> | Implementation<any>)[]
) => {
Severity: Minor
Found in packages/defmulti/src/impls.ts - About 45 mins 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 mixin has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const mixin = (behaviour: any, sharedBehaviour: any = {}) => {
    const instanceKeys = Reflect.ownKeys(behaviour);
    const sharedKeys = Reflect.ownKeys(sharedBehaviour);
    const typeTag = Symbol("isa");

Severity: Minor
Found in packages/api/src/mixin.ts - About 45 mins 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 positions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    *positions() {
        const { data, n } = this;
        for (let i = 0; i < n; i += 8) {
            const x = data[i >>> 3];
            if (!x) continue;
Severity: Minor
Found in packages/bitfield/src/bitfield.ts - About 45 mins 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 vecIterator has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    ctor: VectorConstructor<T>,
    buf: NumericArray,
    num: number,
    start: number,
    cstride: number,
Severity: Minor
Found in packages/vectors/src/iterator.ts - About 45 mins to fix

Function units has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const units = (
    x: number,
    unit: Precision | LocaleUnit,
    isDativ = false,
    unitsOnly = false
Severity: Minor
Found in packages/date/src/i18n.ts - About 45 mins 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 __align has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const __align = (
    bitOffset: number,
    type: keyof typeof TYPES | "union" | "struct",
    spec: any
): number => {
Severity: Minor
Found in packages/unionstruct/src/index.ts - About 45 mins 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 __formatAttribs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const __formatAttribs = (attribs: Partial<Node | Edge>) => {
    const acc: string[] = [];
    for (let a in attribs) {
        let v = attribs[a];
        switch (a) {
Severity: Minor
Found in packages/dot/src/serialize.ts - About 45 mins 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 closestT has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    closestT(p: ReadonlyVec) {
        const { index, points } = this;
        const tmp: Vec = [];
        const closest: Vec = [];
        let minD = Infinity;
Severity: Minor
Found in packages/geom-resample/src/sampler.ts - About 45 mins 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 watchInputs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const watchInputs = (paths: string[], logger: ILogger) => {
    const close = () => {
        logger.info("closing watchers...");
        inputs.forEach((i) => i.watcher.close());
    };
Severity: Minor
Found in packages/meta-css/src/utils.ts - About 45 mins 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 releaseTree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const releaseTree = (tree: any) => {
    if (isArray(tree)) {
        let x: any;
        if ((x = tree[1]) && x.__release === false) {
            return;
Severity: Minor
Found in packages/hdom/src/diff.ts - About 45 mins 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 minError has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const minError = <T>(
    fn: (x: number) => T,
    error: (p: T, q: T) => number,
    q: T,
    res = 16,
Severity: Minor
Found in packages/math/src/min-error.ts - About 45 mins 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