thi-ng/umbrella

View on GitHub

Showing 333 of 1,883 total issues

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

export const compare = (a: any, b: any): number => {
    if (a === b) {
        return 0;
    }
    if (a == null) {
Severity: Minor
Found in packages/compare/src/compare.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 draw has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const draw = (
    ctx: CanvasRenderingContext2D,
    shape: any,
    pstate: DrawState = { attribs: {}, edits: [] }
) => {
Severity: Minor
Found in packages/hiccup-canvas/src/draw.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 setAt has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const setAt = (
    id1: number,
    id2: number,
    id1max: number,
    val: number,
Severity: Minor
Found in packages/sparse/src/compressed.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 removeAttribs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    removeAttribs(el: HDOMNode, attribs: string[], prev: any) {
        for (let i = attribs.length; i-- > 0; ) {
            const a = attribs[i];
            if (a.indexOf("on") === 0) {
                const listeners = el.listeners[a.substring(2)];
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 __buildFullLog has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const __buildFullLog = <T>(
    epc: any[],
    pathPos: any[],
    state: ArrayDiff<T>,
    a: ArrayLike<T>,
Severity: Minor
Found in packages/diff/src/array.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 ringRaw has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const ringRaw = (
    gui: IMGUI,
    id: string,
    x: number,
    y: number,
Severity: Minor
Found in packages/imgui/src/components/ring.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    delete(key: K) {
        const $this = __private.get(this)!;
        const { bins, mask } = $this;
        let i = this.find(key, $this);
        if (i >= 0 && !bins[i]) {
Severity: Minor
Found in packages/associative/src/hash-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 __buildLinearLog has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const __buildLinearLog = <T>(
    epc: any[],
    pathPos: any[],
    state: ArrayDiff<T>,
    a: ArrayLike<T>,
Severity: Minor
Found in packages/diff/src/array.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 ensureLines has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const ensureLines = (
    src: string | string[] | InjectedBody,
    key?: keyof InjectedBody
): Iterable<string> =>
    isString(src)
Severity: Minor
Found in packages/wasm-api-bindgen/src/internal/utils.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 __snip has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const __snip = (
    points: ReadonlyVec[],
    u: number,
    v: number,
    w: number,
Severity: Minor
Found in packages/geom-tessellate/src/earcut.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 __dirs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function* __dirs(
    dir: string,
    match: string | RegExp | Predicate<string> = "",
    logger?: ILogger,
    maxDepth = Infinity,
Severity: Minor
Found in packages/file-io/src/files.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 start has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const start = (
    tree: any,
    opts: Partial<HDOMOpts> = {},
    impl: HDOMImplementation<any> = DEFAULT_IMPL
) => {
Severity: Minor
Found in packages/hdom/src/start.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 __serializeArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const __serializeArray = (tree: any[], ctx: any, state: SerializeState) => {
    if (!tree.length) return "";
    let tag = tree[0];
    return isFunction(tag)
        ? __serialize(tag.apply(null, [ctx, ...tree.slice(1)]), ctx, state)
Severity: Minor
Found in packages/hiccup-markdown/src/serialize.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 query has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const query = <T extends QueryObj = QueryObj>(
    db: T[],
    terms: Nullable<QueryTerm<T>>[],
    opts: Partial<MultiQueryOpts<T>> = {}
) => {
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 toHiccup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const toHiccup = <T extends ANode<T> & IToHiccup>(
    node: T,
    ctx?: any
) => {
    const body = isFunction(node.body) ? node.body(ctx) : deref(node.body);
Severity: Minor
Found in packages/scenegraph/src/hiccup.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 hasNeighborhood has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    hasNeighborhood<N extends INeighborhood<ReadonlyVec, T>>(
        neighborhood: N,
        opts: Partial<QueryNeighborhoodOpts> = {}
    ) {
        const { entries, indices, items, keyFn, tableSize } = this;
Severity: Minor
Found in packages/geom-accel/src/hash-grid.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 close has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    close() {
        if (this.state >= STATE_CLOSING) return;
        const { reads, writes, races } = this;
        this.state =
            reads.length || writes.readable() ? STATE_CLOSING : STATE_CLOSED;
Severity: Minor
Found in packages/csp/src/channel.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 queryNeighborhood has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    queryNeighborhood<N extends INeighborhood<ReadonlyVec, T>>(
        neighborhood: N,
        opts: Partial<QueryNeighborhoodOpts> = {}
    ) {
        const { entries, indices, items, keyFn, tableSize } = this;
Severity: Minor
Found in packages/geom-accel/src/hash-grid.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 _hvline has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const _hvline = (
    buf: Uint32Array,
    a: number,
    b: number,
    astride: number,
Severity: Minor
Found in packages/text-canvas/src/hvline.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 calcCoeffs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected calcCoeffs() {
        const k = Math.tan(PI * this._freq);
        const k2 = k * k;
        const k22 = 2 * (k2 - 1);
        const kq = k / this._q;
Severity: Minor
Found in packages/dsp/src/biquad.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