thi-ng/umbrella

View on GitHub

Showing 362 of 1,895 total issues

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

export function* range3d(
    ...args: number[]
): IterableIterator<[number, number, number]> {
    let fromX!: number, toX!: number, stepX!: number;
    let fromY!: number, toY!: number, stepY!: number;
Severity: Minor
Found in packages/transducers/src/range3d.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 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 wrapSides has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function* wrapSides<T>(
    src: Iterable<T>,
    numLeft = 1,
    numRight = numLeft
): IterableIterator<T> {
Severity: Minor
Found in packages/transducers/src/wrap-sides.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 halton has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function* halton(base: number) {
    let n = 0;
    let d = 1;
    let invB = 1 / base;
    while (true) {
Severity: Minor
Found in packages/lowdisc/src/halton.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 alt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    <T>(parsers: Parser<T>[]): Parser<T> =>
    (ctx) => {
        if (ctx.done) return false;
        for (let i = 0, n = parsers.length; i < n; i++) {
            if (parsers[i](ctx)) {
Severity: Minor
Found in packages/parse/src/combinators/alt.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 diamondSquare has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function* diamondSquare(exp: number) {
    const size = 1 << exp;
    const size1 = size + 1;
    const s2 = size >> 1;
    let res = size;
Severity: Minor
Found in packages/grid-iterators/src/diamond-square.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 svgDoc has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const svgDoc = (attribs: Attribs, ...xs: IShape[]) => {
    attribs = { ...DEFAULT_ATTRIBS, ...attribs };
    if (xs.length > 0) {
        if (!attribs.viewBox) {
            const cbounds = __collBounds(xs, bounds);
Severity: Minor
Found in packages/geom/src/as-svg.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 getAllIDs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getAllIDs(ids: Iterable<number>, fail = false) {
        const index = this.rev;
        const res: T[] = [];
        for (let id of ids) {
            const k = index.get(id);
Severity: Minor
Found in packages/associative/src/bidir-index.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 findNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected findNode(key: K) {
        let { cmp, head } = __private.get(this)!;
        let node: Node<K, V> = head;
        let next: Maybe<Node<K, V>>;
        let down: Maybe<Node<K, V>>;
Severity: Minor
Found in packages/associative/src/sorted-map.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 processedPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function* processedPoints(
    { xaxis, yaxis, project }: VizSpec,
    data: DomainValues,
    pointOnly = false
): IterableIterator<any> {
Severity: Minor
Found in packages/viz/src/plot/utils.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 serializeTag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const serializeTag = (tree: any[], opts: SerializeOpts, path: any[]) => {
    tree = normalize(tree);
    const attribs = tree[1];
    if (attribs.__skip || attribs.__serialize === false) return "";
    opts.keys && attribs.key === undefined && (attribs.key = path.join("-"));
Severity: Minor
Found in packages/hiccup/src/serialize.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 diffObjectDist has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const diffObjectDist = (
    a: Nullable<IObjectOf<any>>,
    b: Nullable<IObjectOf<any>>,
    _equiv: Predicate2<any>
) => {
Severity: Minor
Found in packages/diff/src/object.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 getAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getAll(keys: Iterable<T>, fail = false) {
        const index = this.fwd;
        const res: number[] = [];
        for (let k of keys) {
            const id = index.get(k);
Severity: Minor
Found in packages/associative/src/bidir-index.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 __apply has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const __apply = ($: IShape) => {
    let attribs = $.attribs;
    if (!attribs) return $;
    const { transform: tx, translate: t, rotate: r, scale: s } = attribs;
    if (tx)
Severity: Minor
Found in packages/geom/src/apply-transforms.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 zip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export async function* zip(
    ...src: MaybeAsyncIterable<any>[]
): AsyncIterableIterator<any[]> {
    const iters: (Iterator<any> | AsyncIterator<any>)[] = src.map(
        (s: any) => s[Symbol.iterator]?.() || s[Symbol.asyncIterator]?.()
Severity: Minor
Found in packages/transducers-async/src/zip.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 scatter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const scatter = (
    shape: IShape,
    num: number,
    rnd = SYSTEM,
    out: Vec[] = []
Severity: Minor
Found in packages/geom/src/scatter.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 polyline has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        polyline: ($: Polyline, d) => {
            const chunks: Vec[][] = [];
            let pts = $.points;
            while (true) {
                const sampler = new Sampler(pts);
Severity: Minor
Found in packages/geom/src/split-arclength.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 __drawSolid2D has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const __drawSolid2D = <T extends any[] | TypedArray, P>(
    pts: Nullable<Iterable<ArrayLike<number>>>,
    grid: IGrid2D<T, P>,
    val: P
) => {
Severity: Minor
Found in packages/rasterize/src/draw.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 sampleUniform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    sampleUniform(dist: number, includeLast = false, result: Vec[] = []) {
        const { index, points } = this;
        const total = this.totalLength();
        const delta = dist / total;
        const n = index.length;
Severity: Minor
Found in packages/geom-resample/src/sampler.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