thi-ng/umbrella

View on GitHub

Showing 365 of 1,902 total issues

Avoid deeply nested control flow statements.
Open

                        if (opts.rapids) rapids.push(pts);
Severity: Major
Found in packages/geom-axidraw/src/as-geometry.ts - About 45 mins to fix

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

export const buttonRaw = (
    gui: IMGUI,
    id: string,
    shape: IShape,
    hash: Hash,
Severity: Minor
Found in packages/imgui/src/components/button.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 (z > 0) {
                        let py = prevZ[y];
                        if (
                            distSq3(py[x], q) < sep ||
                            (x > 0 && distSq3(py[x - 1], q) < sep) ||
Severity: Major
Found in packages/poisson/src/stratified.ts - About 45 mins to fix

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 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

Avoid deeply nested control flow statements.
Open

                    if (
                        distSq2(prevY[x], q) < sep ||
                        (x > 0 && distSq2(prevY[x - 1], q) < sep) ||
                        (x < sx1 && distSq2(prevY[x + 1], q) < sep)
                    )
Severity: Major
Found in packages/poisson/src/stratified.ts - About 45 mins to fix

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

Avoid deeply nested control flow statements.
Open

                    if (x > 0 && distSq3(currY[x - 1], q) < sep) continue;
Severity: Major
Found in packages/poisson/src/stratified.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (y > 0) {
                        if (
                            distSq3(prevY[x], q) < sep ||
                            (x > 0 && distSq3(prevY[x - 1], q) < sep) ||
                            (x < sx1 && distSq3(prevY[x + 1], q) < sep)
Severity: Major
Found in packages/poisson/src/stratified.ts - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (c !== undefined) {
                        res[j++] = c;
                    }
Severity: Major
Found in packages/hdom/src/normalize.ts - About 45 mins to fix

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

const coerce = (x: any, isec = false) =>
    isArray(x)
        ? isec
            ? intersect(x)
            : (y: any) => x.includes(y)
Severity: Minor
Found in packages/oquery/src/query.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 qualifiedID has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const qualifiedID = (prefixes: Prefixes, id: string) => {
    if (id[0] === "<" && id[id.length - 1] === ">") {
        return id.substring(1, id.length - 1);
    }
    if (id.indexOf(":") !== -1) {
Severity: Minor
Found in packages/egf/src/prefix.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