thi-ng/umbrella

View on GitHub

Showing 321 of 1,970 total issues

Function uniqueValuesFrom has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const uniqueValuesFrom = (
    k: number,
    fn: Fn0<number>,
    existing: number[] = [],
    maxTrials = 100
Severity: Minor
Found in packages/random/src/unique-indices.ts - About 25 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 _write has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected _write(x: number, wordSize: number) {
        x &= (1 << wordSize) - 1;
        let buf = this.buffer;
        let pos = this.pos;
        let bit = this.bit;
Severity: Minor
Found in packages/bitstream/src/output.ts - About 25 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 makeRels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const makeRels = (spec: AncestorDefs) => {
    const rels: IObjectOf<Set<PropertyKey>> = {};
    for (let k in spec) {
        const val = spec[k];
        rels[k] =
Severity: Minor
Found in packages/defmulti/src/defmulti.ts - About 25 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 typedef has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const typedef = (
    spec: Field[],
    struct: boolean,
    buf?: ArrayBuffer | null,
    offset = 0,
Severity: Minor
Found in packages/unionstruct/src/index.ts - About 25 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 indexAt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    indexAt(t: number) {
        const pts = this.points;
        const n = pts.length - 1;
        if (n < 0) {
            return;
Severity: Minor
Found in packages/geom-resample/src/sampler.ts - About 25 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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(
        side: ISubscribable<S>,
        opts?: Partial<SidechainPartitionOpts<S>>
    ) {
        opts = __optsWithID("sidepart", opts);
Severity: Minor
Found in packages/rstream/src/sidechain-partition.ts - About 25 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 indexUnsafe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    indexUnsafe(i: number, ids?: K[]): any {
        const res = <SOATuple<K, Vec>>{};
        if (ids) {
            for (let i = ids.length; i-- > 0; ) {
                const id = ids[i];
Severity: Minor
Found in packages/soa/src/soa.ts - About 25 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 State.ATTRIB_VALUE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    [State.ATTRIB_VALUE]: (state, ch) => {
        state.pos++;
        let v = state.val!;
        if (v.charAt(v.length - 1) == "\\") {
            const e = ESCAPES[ch];
Severity: Minor
Found in packages/sax/src/index.ts - About 25 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 State.DOCTYPE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    [State.DOCTYPE]: (state, ch) => {
        state.pos++;
        if (state.phase! < 8) {
            if (ch === "DOCTYPE "[state.phase!]) {
                state.phase!++;
Severity: Minor
Found in packages/sax/src/index.ts - About 25 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 fromIterable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const fromIterable = <T>(
    src: Iterable<T>,
    opts: Partial<FromIterableOpts> = {}
) =>
    stream<T>((stream) => {
Severity: Minor
Found in packages/rstream/src/iterable.ts - About 25 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 malloc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    malloc(bytes: number) {
        if (bytes <= 0) {
            return 0;
        }
        const paddedSize = align(bytes + SIZEOF_MEM_BLOCK, this.align);
Severity: Minor
Found in packages/malloc/src/pool.ts - About 25 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 equiv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    equiv(o: any) {
        if (
            !(o instanceof AList || isArrayLike(o)) ||
            this._length !== o.length
        ) {
Severity: Minor
Found in packages/dcons/src/alist.ts - About 25 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 slice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    slice(from = 0, to = this.length) {
        let a = from < 0 ? from + this._length : from;
        let b = to < 0 ? to + this._length : to;
        if (a < 0 || b < 0) {
            illegalArgs("invalid indices: ${from} / ${to}");
Severity: Minor
Found in packages/dcons/src/dcons.ts - About 25 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 defWorker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const defWorker = (worker: WorkerSource) =>
    worker instanceof Worker
        ? worker
        : isFunction(worker)
        ? worker()
Severity: Minor
Found in packages/rstream/src/defworker.ts - About 25 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 trace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const trace = (prefix?: any): ISubscriber<any> => ({
    next(x) {
        prefix ? console.log(prefix, x) : console.log(x);
    },
    done() {
Severity: Minor
Found in packages/rstream/src/trace.ts - About 25 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 mallocTop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private mallocTop(
        block: number,
        prev: number,
        blockSize: number,
        paddedSize: number,
Severity: Minor
Found in packages/malloc/src/pool.ts - About 25 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 route has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    route(src: string): RouteMatch | undefined {
        if (
            this.config.removeTrailingSlash &&
            src.charAt(src.length - 1) === this.config.separator
        ) {
Severity: Minor
Found in packages/router/src/basic.ts - About 25 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 format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    format(...args: any[]) {
        let [id, params] = args;
        let match: Partial<RouteMatch>;
        switch (args.length) {
            case 2:
Severity: Minor
Found in packages/router/src/basic.ts - About 25 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 attribArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    attribArray(id: string) {
        const spec = this.specs[id];
        ensureSpec(spec, id);
        const n = this.capacity;
        const size = spec.size;
Severity: Minor
Found in packages/vector-pools/src/attrib-pool.ts - About 25 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 attribValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    *attribValues(id: string) {
        const spec = this.specs[id];
        ensureSpec(spec, id);
        const buf = this.attribs[id];
        const stride = spec.stride!;
Severity: Minor
Found in packages/vector-pools/src/attrib-pool.ts - About 25 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