thi-ng/umbrella

View on GitHub

Showing 365 of 1,902 total issues

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

    (min: ReadonlyVec, max: ReadonlyVec): GlobalConstraint =>
    (p, boid) => {
        const [x, y] = p;
        let wrap = false;
        if (x < min[0] || x > max[0]) {
Severity: Minor
Found in packages/boids/src/constrain.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 ((<FTerm>p)($p)) {
                            collectFull(res, $s, sval);
                            break;
                        }
Severity: Major
Found in packages/oquery/src/query.ts - About 45 mins to fix

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

    (min: ReadonlyVec, max: ReadonlyVec): GlobalConstraint =>
    (p, boid) => {
        let [x, y, z] = p;
        let wrap = false;
        if (x < min[0] || x > max[0]) {
Severity: Minor
Found in packages/boids/src/constrain.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 grahamScan2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const grahamScan2 = (pts: ReadonlyVec[], eps = EPS) => {
    const num = pts.length;
    if (num <= 3) return pts.slice();
    let h = 1;
    let i;
Severity: Minor
Found in packages/geom-hull/src/graham-scan.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 compareByKeys3 has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    a: string | Fn<any, any>,
    b: string | Fn<any, any>,
    c: string | Fn<any, any>,
    cmpA: Comparator<any> = compare,
    cmpB: Comparator<any> = compare,
Severity: Minor
Found in packages/compare/src/keys.ts - About 45 mins to fix

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

    childForPoint(p: ReadonlyVec): Maybe<NodeInfo<T>> {
        if (this.enabled) {
            const children = this.children;
            for (let i = children.length; i-- > 0; ) {
                const n = children[i].childForPoint(p);
Severity: Minor
Found in packages/scenegraph/src/anode.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 floydRivest has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    buf: any[] | TypedArray,
    k = 1,
    cmp: Comparator<any> = compare,
    left = 0,
    right = buf.length - 1
Severity: Minor
Found in packages/arrays/src/floyd-rivest.ts - About 35 mins to fix

Function quickSort has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    arr: any,
    _cmp: Comparator<any> = compare,
    _swap: Fn3<any, number, number, void> = swap,
    start = 0,
    end = arr.length - 1
Severity: Minor
Found in packages/arrays/src/quicksort.ts - About 35 mins to fix

Function clipped has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    src: Iterable<number[]>,
    left: number,
    top: number,
    right: number,
    bottom: number
Severity: Minor
Found in packages/grid-iterators/src/clipping.ts - About 35 mins to fix

Function floodFill has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    pred: Predicate2<number>,
    x: number,
    y: number,
    width: number,
    height: number
Severity: Minor
Found in packages/grid-iterators/src/flood-fill.ts - About 35 mins to fix

Function isolines has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    src: ReadonlyVec,
    w: number,
    h: number,
    iso: number,
    scale: ReadonlyVec | number = 1
Severity: Minor
Found in packages/geom-isoline/src/index.ts - About 35 mins to fix

Function withIndentation has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    lines: string[],
    indent: string,
    scopeStart: RegExp,
    scopeEnd: RegExp,
    level = 0
Severity: Minor
Found in packages/wasm-api-bindgen/src/internal/utils.ts - About 35 mins to fix

Function __files has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    dir: string,
    match: string | RegExp | Predicate<string> = "",
    logger?: ILogger,
    maxDepth = Infinity,
    depth = 0
Severity: Minor
Found in packages/file-io/src/files.ts - About 35 mins to fix

Function __dirs has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    dir: string,
    match: string | RegExp | Predicate<string> = "",
    logger?: ILogger,
    maxDepth = Infinity,
    depth = 0
Severity: Minor
Found in packages/file-io/src/files.ts - About 35 mins to fix

Function diffTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    diffTree(opts, parent, prev, curr, child?) {
Severity: Minor
Found in packages/hdom/src/default.ts - About 35 mins to fix

Function createTree has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    createTree(opts, parent, tree, child?, init?) {
Severity: Minor
Found in packages/hdom/src/default.ts - About 35 mins to fix

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

        group: ($: Group) => {
            const { attribs, children } = $;
            const attr = { ...DEFAULT_ATTRIBS, ...__sdfAttribs(attribs) };
            __validateAttribs(attr);
            const $children = children.map(asSDF);
Severity: Minor
Found in packages/geom-sdf/src/as-sdf.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 concatA has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const concatA = <T>(...args: Nullable<ArrayLike<T>>[]) => {
    const seqs: ArrayLike<T>[] = [];
    for (let i = 0, n = args.length; i < n; i++) {
        const x = args[i];
        x && x.length && seqs.push(x);
Severity: Minor
Found in packages/seq/src/concat.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 interleave has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function* interleave(...inputs: Iterable<any>[]) {
    let n = inputs.length;
    if (n === 0) {
        illegalArity(0);
    }
Severity: Minor
Found in packages/iterators/src/interleave.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 xfNest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    (parser: Parser<string>): ScopeTransform<string> =>
    (scope, ctx) => {
        if (!scope) return;
        const src = scope.result || xfJoin({ ...scope })!.result;
        const inner = defContext(src, ctx.opts);
Severity: Minor
Found in packages/parse/src/xform/nest.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

Severity
Category
Status
Source
Language