thi-ng/umbrella

View on GitHub

Showing 366 of 1,904 total issues

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

export const extractBody = (body: any[], acc: Primitive[] = []) => {
    for (let x of isPlainObject(body[1]) ? body.slice(2) : body) {
        if (isPrimitive(x)) acc.push(x);
        else if (isArray(x)) extractBody(x, acc);
    }
Severity: Minor
Found in packages/hiccup-markdown/src/parse.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 __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 __endShape has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const __endShape = (
    ctx: CanvasRenderingContext2D,
    attribs: IObjectOf<any>,
    doFill = true
) => {
Severity: Minor
Found in packages/hiccup-canvas/src/internal/end-shape.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: 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 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/associative/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

        if (x >= 0xa0 && x <= 0xbf) return $string(x - 0xa0); // fixstr
Severity: Major
Found in packages/msgpack/src/deserialize.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 __serializeIter(tree, ctx, state);
Severity: Major
Found in packages/hiccup-markdown/src/serialize.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return __serializeIter(tree, ctx, state);
Severity: Major
Found in packages/hiccup-markdown/src/serialize.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

Avoid too many return statements within this function.
Open

        return __serialize(tree(ctx), ctx, state);
Severity: Major
Found in packages/hiccup-markdown/src/serialize.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return [
                u * Math.cos(t) - ba3,
                u * Math.cos(t - k) - ba3,
                u * Math.cos(t - 2 * k) - ba3,
            ];
Severity: Major
Found in packages/math/src/solve.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 __serialize(tree.toHiccup(ctx), ctx, state);
Severity: Major
Found in packages/hiccup-markdown/src/serialize.ts - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return __serialize(tree.deref(), ctx, state);
Severity: Major
Found in packages/hiccup-markdown/src/serialize.ts - About 30 mins to fix
Severity
Category
Status
Source
Language