thi-ng/umbrella

View on GitHub

Showing 362 of 1,897 total issues

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

export const __drawShader2D = <T extends any[] | TypedArray, P>(
    pts: Nullable<Iterable<ArrayLike<number>>>,
    grid: IGrid2D<T, P>,
    shader: Shader2D<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 percolateDown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected percolateDown(i: number, vals = this.values) {
        const n = vals.length;
        const node = vals[i];
        const cmp = this.compare;
        let child = (i << 1) + 1;
Severity: Minor
Found in packages/heaps/src/heap.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 defn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function defn(type: Type, id: Nullable<string>, _args: Arg<any>[], _body: (...xs: Sym<any>[]) => ScopeBody): Func<any> {
    id = id || gensym();
    const args = _args.map(defArg);
    const body = <Term<any>[]>(
        _body(...args.map((x) => sym(x.type, x.id, x.opts))).filter(
Severity: Minor
Found in packages/shader-ast/src/ast/function.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 widenUint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const widenUint = (t: UintType) =>
    t === "u8" || t === "u8c"
        ? "u16"
        : t === "u16"
        ? "u32"
Severity: Minor
Found in packages/api/src/typedarray.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 radio has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const radio = (
    gui: IMGUI,
    layout: IGridLayout<any> | LayoutBox,
    id: string,
    horizontal: boolean,
Severity: Minor
Found in packages/imgui/src/components/radio.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 as has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    as(fmt: IntFormat) {
        const {
            width,
            height,
            stride: [stride],
Severity: Minor
Found in packages/pixel/src/float.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 toggleRaw has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const toggleRaw = (
    gui: IMGUI,
    id: string,
    x: number,
    y: number,
Severity: Minor
Found in packages/imgui/src/components/toggle.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 pointAt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    pointAt(t: number): Maybe<Vec> {
        const pts = this.points;
        const n = pts.length - 1;
        if (n < 0) {
            return;
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

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

export const compare: Comparator<VClock> = (a, b) => {
    let ah = false;
    let al = false;
    for (let id of uniqueIDs(a, b)) {
        const delta = (a[id] || 0) - (b[id] || 0);
Severity: Minor
Found in packages/vclock/src/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 __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

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

export const exists = (obj: any, path: Path) => {
    if (obj == null) {
        return false;
    }
    path = toPath(path);
Severity: Minor
Found in packages/paths/src/path.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 __declOrder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const __declOrder = (coll: TypeColl) =>
    topoSort(coll, (type) => {
        const fields =
            isStruct(type) || isUnion(type)
                ? type.fields
Severity: Minor
Found in packages/wasm-api-bindgen/src/c11.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 cohesion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const cohesion = (
    maxDist: ScalarOrField,
    weight: ScalarOrField = 1
): IBoidBehavior => {
    const $maxDist = __ensureFn(maxDist);
Severity: Minor
Found in packages/boids/src/behaviors/cohesion.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 extractBody has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const extractBody = (body: any[], acc: Primitive[] = []) => {
    for (let x of isPlainObject(body[1]) ? body.slice(2) : body) {
        if (isPrimitive(x)) acc.push(x);
        else if (isArray(x)) extractBody(x, acc);
    }
Severity: Minor
Found in packages/hiccup-markdown/src/parse.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 __endShape has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const __endShape = (
    ctx: CanvasRenderingContext2D,
    attribs: IObjectOf<any>,
    doFill = true
) => {
Severity: Minor
Found in packages/hiccup-canvas/src/internal/end-shape.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 wrap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const wrap: FnN3 = (x, min, max) => {
    if (min === max) return min;
    if (x > max) {
        const d = max - min;
        x -= d;
Severity: Minor
Found in packages/math/src/interval.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 assert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    ? (test: boolean | (() => boolean), msg?: string | (() => string)) => {
            if ((typeof test === "function" && !test()) || !test) {
                throw new AssertionError(
                    typeof msg === "function" ? msg() : msg
                );
Severity: Minor
Found in packages/errors/src/assert.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 spacesToTabsLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const spacesToTabsLine = (line: string, tabSize = 4) => {
    const re = /\s{2,}/g;
    let i = 0;
    let res = "";
    let m: RegExpExecArray | null;
Severity: Minor
Found in packages/strings/src/tabs.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 __drawPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const __drawPoints = (
    ctx: CanvasRenderingContext2D,
    opts: IObjectOf<any>,
    pts: Iterable<ReadonlyVec>,
    cmd: "fill" | "stroke",
Severity: Minor
Found in packages/hiccup-canvas/src/points.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