thi-ng/umbrella

View on GitHub

Showing 333 of 1,891 total issues

Function diagonalSlopeX has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export function* diagonalSlopeX(opts: DiagonalSlopeOpts) {
    const { cols, rows, tx } = __opts(opts);
    const maxX = cols - 1;
    const slope = opts.slope | 0;
    assert(slope > 0, "slope must be > 0");
Severity: Minor
Found in packages/grid-iterators/src/diagonal-slope.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 __collect has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const __collect = (stack: any[], x: any, utf8 = false) => {
    const parent = peek(stack);
    if (!parent) return x;
    if (parent.type === Type.LIST) {
        parent.val.push(utf8 && isArray(x) ? utf8Decode(x) : x);
Severity: Minor
Found in packages/bencode/src/decode.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 encode has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const encode = (
    pixels: Uint32Array,
    width: number,
    height: number,
    detailX = 4,
Severity: Minor
Found in packages/blurhash/src/encode.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 earCutComplex has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    (holeIDs: number[] = [], hashThreshold = 80): Tessellator =>
    (tess, faces, pids) => {
        let points = tess.pointsForIDs(pids);
        const hasHoles = !!holeIDs.length;
        const outerLen = hasHoles ? holeIDs[0] : points.length;
Severity: Minor
Found in packages/geom-tessellate/src/earcut-complex.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 __encodeCrossings has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const __encodeCrossings = (
    src: ReadonlyVec,
    w: number,
    h: number,
    iso: number
Severity: Minor
Found in packages/geom-isoline/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 classifyPolyPair has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const classifyPolyPair = (
    px: number,
    py: number,
    ax: number,
    ay: number,
Severity: Minor
Found in packages/geom-isec/src/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 MIME_TYPES has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const MIME_TYPES = ((defs: any) => {
    const res: Record<string, string[]> = {};
    for (let groupID in defs) {
        const group = defs[groupID];
        for (let type in group) {
Severity: Minor
Found in packages/mime/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 __mergeState has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const __mergeState = (
    ctx: CanvasRenderingContext2D,
    state: DrawState,
    attribs: IObjectOf<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 hydrateTree has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const hydrateTree = <T>(
    opts: Partial<HDOMOpts>,
    impl: HDOMImplementation<any>,
    parent: T,
    tree: any,
Severity: Minor
Found in packages/hdom/src/dom.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 remove has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    remove(vec: T): boolean {
        if (this.has(vec)) {
            this._length--;
            this.freeIDs.push(vec.offset);
            const v = <CellVec<T>>vec;
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 mutate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    mutate(tree: ASTNode<OP, T>, maxDepth = 1) {
        const { rnd, probMutate, maxDepth: limit } = this.opts;
        let loc = this.asZipper(tree).next!;
        if (!loc) return tree;
        while (true) {
Severity: Minor
Found in packages/gp/src/ast.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 14 (exceeds 5 allowed). Consider refactoring.
Open

        path: ($: Path, eps = 1e-6) => {
            const $simplifySegments = (segments: PathSegment2[]) => {
                const res: PathSegment2[] = [];
                const n = segments.length;
                let points!: Vec[] | null;
Severity: Minor
Found in packages/geom/src/simplify.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 handleTextfieldKeys has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const handleTextfieldKeys = (
    gui: IMGUI,
    state: { cursor: number; offset: number },
    filter: Predicate<string>,
    txt: string,
Severity: Minor
Found in packages/imgui/src/behaviors/text.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 sliderVRaw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

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

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

const __resolve = (
    root: any,
    path: LookupPath,
    resolved: IObjectOf<boolean>,
    stack: string[],
Severity: Minor
Found in packages/resolve-map/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 joinWith has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const joinWith = <A, B>(
    a: Set<A>,
    b: Set<B>,
    kmap: { [id in keyof A]?: keyof B }
): Set<any> => {
Severity: Minor
Found in packages/associative/src/join.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 fold has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const fold = (i: Readonly<Interval>, x: number, eps = DEFAULT_EPS) => {
    do {
        if ((i.lopen && x <= i.l) || (!i.lopen && x < i.l)) {
            x = x - i.l + i.r - (i.ropen ? eps : 0);
        } else if ((i.ropen && x >= i.r) || (!i.ropen && x > i.r)) {
Severity: Minor
Found in packages/intervals/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 textLayerImpl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const textLayerImpl: CompLayerFn = async (layer, _, ctx) => {
    let {
        type: __,
        bg = "#0000",
        body = "",
Severity: Minor
Found in packages/imago/src/layers/text.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 sliderHRaw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

export const sliderHRaw = (
    gui: IMGUI,
    id: string,
    x: number,
    y: number,
Severity: Minor
Found in packages/imgui/src/components/sliderh.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