thi-ng/umbrella

View on GitHub

Showing 333 of 1,883 total issues

Function closestPointPolyline has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const closestPointPolyline = (
    p: ReadonlyVec,
    pts: ReadonlyArray<Vec>,
    closed = false,
    out: Vec = []
Severity: Minor
Found in packages/geom-closest-point/src/line.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 update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    async update(val: T) {
        this.inner && (await this.inner.unmount());
        this.inner = undefined;
        if (val != null) {
            this.val = val;
Severity: Minor
Found in packages/rdom/src/switch.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 stringD has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    <T>(str: ArrayLike<T>): Parser<T> =>
    (ctx) => {
        if (ctx.done) return false;
        const state = ctx.state.copy();
        const reader = ctx.reader;
Severity: Minor
Found in packages/parse/src/prims/string.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 update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    async update(curr: T[]) {
        if (!curr) return;
        const { ctor, equiv, items, prev, el: parent } = this;
        const nb = curr.length;
        let na = prev!.length;
Severity: Minor
Found in packages/rdom/src/list.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 readPFM has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const readPFM = (buf: Uint8Array, linearRGB = true) => {
    const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
    if (view.getUint16(0, false) !== 0x5046) __error();
    if (view.getUint8(2) !== 0x0a) __error();
    const idx = buf.indexOf(0x0a, 3);
Severity: Minor
Found in packages/pixel-io-pfm/src/read.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 string has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    <T>(str: ArrayLike<T>, id = "string"): Parser<T> =>
    (ctx) => {
        if (ctx.done) return false;
        const scope = ctx.start(id);
        const state = scope.state!;
Severity: Minor
Found in packages/parse/src/prims/string.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 mergeClasses has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const mergeClasses = (
    existing: string | SVGAnimatedString,
    val: any
) => {
    val = deref(val);
Severity: Minor
Found in packages/hiccup/src/attribs.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 __laneStacking has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const __laneStacking = <T>(data: [number[], T][], pad = 0) =>
    data.reduce((acc, item) => {
        const rx = item[0];
        for (let i = 0; true; i++) {
            const row = acc[i];
Severity: Minor
Found in packages/viz/src/plot/stacked-intervals.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 asPBM has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const asPBM = (buf: IntBuffer, comments?: string[]) => {
    const { data, width, height } = buf;
    const { dest, start, abgr } = __initHeader(
        "P4",
        0,
Severity: Minor
Found in packages/pixel-io-netpbm/src/write.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 roundedRect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const roundedRect = (
    pos: Vec,
    [w, h]: Vec,
    radii:
        | number
Severity: Minor
Found in packages/geom/src/rounded-rect.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 cropProc has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const cropProc: Processor = async (spec, input, ctx) => {
    const { aspect, border, gravity, pos, size, ref, unit } = <CropSpec>spec;
    if (border == null && size == null)
        illegalArgs("require `border` or `size` option");
    if (border != null) {
Severity: Minor
Found in packages/imago/src/ops/crop.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 samplePoisson has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const samplePoisson = (_opts: PoissonOpts) => {
    const opts = {
        rnd: SYSTEM,
        iter: 1,
        jitter: 1,
Severity: Minor
Found in packages/poisson/src/poisson.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 delete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    delete(key: K) {
        const $this = __private.get(this)!;
        let node: Maybe<Node<K, V>> = this.findNode(key);
        if (node.k === undefined || $this.cmp(node.k, key) !== 0) return false;
        // descent to lowest level
Severity: Minor
Found in packages/sorted-map/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 __applyTransform has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const __applyTransform = (
    ctx: CanvasRenderingContext2D,
    attribs: IObjectOf<any>
) => {
    let v: any;
Severity: Minor
Found in packages/hiccup-canvas/src/internal/state.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 __queryFFN has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const __queryFFN: QueryImpl = (res, db: any, s, p) => {
    for (let $s in db) {
        if ((<FTerm>s)($s)) {
            const sval = db[$s];
            for (let $p in sval) {
Severity: Minor
Found in packages/oquery/src/query.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 __resolveVarName has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const __resolveVarName = (name: string, ctx: GeneratorContext) => {
    if (name.indexOf(".") == -1) return name;
    let resolved = "";
    for (let x of name.split(".")) {
        const $name = resolved + "." + x;
Severity: Minor
Found in packages/proctext/src/generate.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 utf8Decode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const utf8Decode = (buf: Uint8Array, start: number, num: number) => {
    const end = start + num;
    let i = start;
    let result = "";
    let c: number;
Severity: Minor
Found in packages/strings/src/utf8.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 braitenberg2 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const braitenberg2 = (
    field: Fn<ReadonlyVec, number>,
    lookahead: number,
    angle: number,
    weight: ScalarOrField = 1
Severity: Minor
Found in packages/boids/src/behaviors/braitenberg.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 add has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    add(): T {
        const v = <CellVec<T>>this.alloc();
        if (v) {
            if (this.tail) {
                v.prev = this.tail;
Severity: Minor
Found in packages/vector-pools/src/linked-list.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 nth has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    nth(n: number): Maybe<T> {
        if (n < 0) {
            n += this._length;
        }
        if (n < 0 || n >= this._length) {
Severity: Minor
Found in packages/vector-pools/src/linked-list.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