thi-ng/umbrella

View on GitHub

Showing 371 of 1,964 total issues

Function sutherlandHodgeman has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const sutherlandHodgeman = (
    pts: ReadonlyVec[],
    bounds: ReadonlyVec[],
    bc?: ReadonlyVec,
    eps = EPS
Severity: Minor
Found in packages/geom-clip-poly/src/index.ts - About 1 hr 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 kmeans has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const kmeans = <T extends ReadonlyVec>(
    k: number,
    samples: T[],
    opts?: Partial<KMeansOpts>
) => {
Severity: Minor
Found in packages/k-means/src/kmeans.ts - About 1 hr 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 exposeGlobal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const exposeGlobal = (id: string, value: any, always = false) => {
    const glob: any =
        typeof global !== "undefined"
            ? global
            : typeof window !== "undefined"
Severity: Minor
Found in packages/expose/src/index.ts - About 1 hr 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 rule has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        rule: ($, lang, opts, flags) => {
            const [id, body, xf] = $.children!;
            opts.debug && console.log(`rule: ${id.result}`, xf);
            const acc: Parser<string>[] = [];
            for (let b of body.children!) {
Severity: Minor
Found in packages/parse/src/grammar.ts - About 1 hr 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 setAttrib has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    setAttrib(el: HDOMNode, id: string, val: any, attribs?: any) {
        if (id.startsWith("__")) return;
        const isListener = id.indexOf("on") === 0;
        if (!isListener && typeof val === "function") {
            val = val(attribs);
Severity: Minor
Found in packages/hdom-mock/src/index.ts - About 1 hr 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 convexity has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Confirmed

export const convexity = (pts: ReadonlyVec[], eps = EPS) => {
    let n = pts.length;
    if (n < 3) {
        return n < 2 ? Convexity.ILLEGAL : Convexity.COLINEAR;
    }
Severity: Minor
Found in packages/geom-poly-utils/src/convexity.ts - About 1 hr 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 convolveOpen has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const convolveOpen = (
    pts: ReadonlyVec[],
    kernel: number[],
    t = 0.5,
    iter = 1
Severity: Minor
Found in packages/geom-poly-utils/src/convolve.ts - About 1 hr 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 entries has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    *entries(key?: K, max = false): IterableIterator<Pair<K, V>> {
        if (key === undefined) {
            yield* this;
            return;
        }
Severity: Minor
Found in packages/associative/src/sorted-map.ts - About 1 hr 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 path has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        path: ($: Path, p, out) => {
            let minD = Infinity;
            const $closestPSegment = (segments: PathSegment[]) => {
                for (let s of segments) {
                    if (!s.geo) continue;
Severity: Minor
Found in packages/geom/src/closest-point.ts - About 1 hr 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 toPath has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const toPath = (path: Path): readonly NumOrString[] => {
    if (isArray(path)) {
        if (!path.every((x) => isString(x) || isNumber(x))) __illegal(path);
        return <any[]>path;
    } else {
Severity: Minor
Found in packages/paths/src/path.ts - About 1 hr 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 computeCell has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    computeCell(
        { rule, kernel, weights, fn }: CAConfig1D,
        x: number,
        val: number
    ) {
Severity: Minor
Found in packages/cellular/src/1d.ts - About 1 hr 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 traverse has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const traverse = (
    subs: ISubscribable<any>[],
    opts?: Partial<DotOpts>,
    state?: TraversalState
) => {
Severity: Minor
Found in packages/rstream-dot/src/index.ts - About 1 hr 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 __generateFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const __generateFields = (
    gen: ICodeGen,
    parent: Struct | Union,
    coll: TypeColl,
    opts: CodeGenOpts,
Severity: Minor
Found in packages/wasm-api-bindgen/src/c11.ts - About 1 hr 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 bitWriter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const bitWriter = (capacity = 16) => {
    let buf = new Uint8Array(capacity);
    let pos = 0;
    let bit = 8;

Severity: Minor
Found in packages/bitstream/src/simple.ts - About 1 hr 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 authorLink has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const authorLink = (author: string | User) => {
    if (isString(author)) {
        const [name, a, b] = author.split(/\s*[<(]/);
        const href = b ? (b[b.length - 1] == ")" ? b : a) : a ? a : "";
        return href.length && href[href.length - 1] === ")"
Severity: Minor
Found in packages/transclude/src/tpl/pkg.ts - About 1 hr 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 tween has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function* tween<A, B, C>(opts: TweenOpts<A, B, C>): IterableIterator<C> {
    const { min, max, num, init, mix, stops } = opts;
    const easing = opts.easing || ((x: number) => x);
    let l = stops.length;
    if (l < 1) return;
Severity: Minor
Found in packages/transducers/src/tween.ts - About 1 hr 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 findSequence has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function findSequence(
    buf: any[] | TypedArray,
    needle: ArrayLike<any>,
    start = 0
) {
Severity: Minor
Found in packages/arrays/src/find-sequence.ts - About 1 hr 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 liangBarsky has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const liangBarsky: FnU8<number, Maybe<Tuple<number, 4>>> = (
    ax,
    ay,
    bx,
    by,
Severity: Minor
Found in packages/grid-iterators/src/clipping.ts - About 1 hr 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 raf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const raf = (
    opts?: Partial<RAFOpts>
): ClosableAsyncGenerator<number> & IDeref<Maybe<number>> => {
    let frame = 0;
    let t0 = opts?.t0 || 0;
Severity: Minor
Found in packages/transducers-async/src/raf.ts - About 1 hr 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 diagonal2d has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function* diagonal2d(opts: GridIterOpts2D) {
    const { cols, rows, tx } = __opts(opts);
    const num = cols * rows - 1;
    for (let x = 0, y = 0, nx = 1, ny = 0, i = 0; i <= num; i++) {
        yield tx(x, y);
Severity: Minor
Found in packages/grid-iterators/src/diagonal.ts - About 1 hr 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