thi-ng/umbrella

View on GitHub

Showing 333 of 1,891 total issues

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

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

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

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

Consider simplifying this complex logical expression.
Open

            if (
                __isLocallyInside(v, hole) &&
                (tan < tanMin ||
                    (tan === tanMin &&
                        (px > m.x ||
Severity: Major
Found in packages/geom-tessellate/src/earcut-complex.ts - About 40 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 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 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 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 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 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
Severity
Category
Status
Source
Language