thi-ng/umbrella

View on GitHub

Showing 333 of 1,891 total issues

Function __drawPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const __drawPoints = (
    ctx: CanvasRenderingContext2D,
    opts: IObjectOf<any>,
    pts: Iterable<ReadonlyVec>,
    cmd: "fill" | "stroke",
Severity: Minor
Found in packages/hiccup-canvas/src/points.ts - About 35 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 wrap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const wrap: FnN3 = (x, min, max) => {
    if (min === max) return min;
    if (x > max) {
        const d = max - min;
        x -= d;
Severity: Minor
Found in packages/math/src/interval.ts - About 35 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 assert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    ? (test: boolean | (() => boolean), msg?: string | (() => string)) => {
            if ((typeof test === "function" && !test()) || !test) {
                throw new AssertionError(
                    typeof msg === "function" ? msg() : msg
                );
Severity: Minor
Found in packages/errors/src/assert.ts - About 35 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 __drawPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const __drawPoints = (
    ctx: CanvasRenderingContext2D,
    opts: IObjectOf<any>,
    pts: ArrayLike<number>,
    cmd: "fill" | "stroke",
Severity: Minor
Found in packages/hiccup-canvas/src/packed-points.ts - About 35 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 cohesion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const cohesion = (
    maxDist: ScalarOrField,
    weight: ScalarOrField = 1
): IBoidBehavior => {
    const $maxDist = __ensureFn(maxDist);
Severity: Minor
Found in packages/boids/src/behaviors/cohesion.ts - About 35 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 spacesToTabsLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const spacesToTabsLine = (line: string, tabSize = 4) => {
    const re = /\s{2,}/g;
    let i = 0;
    let res = "";
    let m: RegExpExecArray | null;
Severity: Minor
Found in packages/strings/src/tabs.ts - About 35 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 compareLex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const compareLex: Comparator<string> = (a, b) => {
    const ma = BOUNDARY.exec(a);
    const mb = BOUNDARY.exec(b);
    return ma && mb
        ? __compare2(
Severity: Minor
Found in packages/compare/src/string.ts - About 35 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 __mapSubject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    (subject: any) =>
    ([p, o]: [any, any]) => {
        if (isArray(o)) {
            return mapcat(
                (o) =>
Severity: Minor
Found in packages/rstream-query/src/convert.ts - About 35 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 limitSolutions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const limitSolutions = (n: number) =>
    map((sol: Solutions) => {
        if (sol.size <= n) {
            return sol;
        }
Severity: Minor
Found in packages/rstream-query/src/xforms.ts - About 35 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 too many return statements within this function.
Open

        return true;
Severity: Major
Found in packages/trie/src/multi-trie.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

                            return r(
                                acc,
                                fromUtf8CodePoint(
                                    ((u0 & 1) << 30) |
                                        (u1 << 24) |
Severity: Major
Found in packages/transducers-binary/src/utf8.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

                                return r(
                                    acc,
                                    fromUtf8CodePoint(
                                        ((u0 & 3) << 24) |
                                            (u1 << 18) |
Severity: Major
Found in packages/transducers-binary/src/utf8.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return -b.compare(a);
Severity: Major
Found in packages/compare/src/compare.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return a < b ? -1 : a > b ? 1 : 0;
Severity: Major
Found in packages/compare/src/compare.ts - About 30 mins to fix

Function blit2d has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function blit2d(
    dest: any[],
    dpos: ArrayLike<number>,
    dsize: ArrayLike<number>,
    src: ArrayLike<any>,
Severity: Minor
Found in packages/arrays/src/blit.ts - About 25 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 zip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function* zip(...src: Iterable<any>[]): IterableIterator<any[]> {
    const iters = src.map((s) => s[Symbol.iterator]());
    while (true) {
        const tuple = [];
        for (let i of iters) {
Severity: Minor
Found in packages/transducers/src/zip.ts - About 25 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 concat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const concat = <T>(
    ...args: Nullable<ISeq<T> | ISeqable<T>>[]
): Maybe<ISeq<T>> => {
    const seqs: ISeq<T>[] = [];
    for (let i = 0, n = args.length; i < n; i++) {
Severity: Minor
Found in packages/seq/src/concat.ts - About 25 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 suffixes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    *suffixes(prefix: K, withPrefix = false, sep = "") {
        const node = this.find(prefix);
        if (node) {
            yield* node.keys(
                sep,
Severity: Minor
Found in packages/trie/src/multi-trie.ts - About 25 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 add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    add(key: K, val: V) {
        // eslint-disable-next-line no-this-alias -- tree traversal
        let node: MultiTrie<K, V> = this;
        for (let i = 0, n = key.length; i < n; i++) {
            const k = key[i].toString();
Severity: Minor
Found in packages/trie/src/multi-trie.ts - About 25 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 repeatedly3d has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function* repeatedly3d<T>(
    fn: FnU3<number, T>,
    cols: number,
    rows: number,
    slices: number
Severity: Minor
Found in packages/transducers/src/repeatedly3d.ts - About 25 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