thi-ng/umbrella

View on GitHub

Showing 333 of 1,883 total issues

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

export const meansLatLon: CentroidStrategy = () => {
    let lat = 0;
    let lon = 0;
    let n = 0;
    return {
Severity: Minor
Found in packages/k-means/src/kmeans.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 add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    add(key: K, val: V) {
        // eslint-disable-next-line no-this-alias -- tree traversal
        let node: MultiTrie<K, V> = this;
        for (let i = 0, n = key.length; i < n; i++) {
            const k = key[i].toString();
Severity: Minor
Found in packages/trie/src/multi-trie.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 convolve1d has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function convolve1d(
    opts: Convolution1DOpts,
    indices?: Iterable<number>
): any {
    if (indices) {
Severity: Minor
Found in packages/transducers/src/convolve.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 timeIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected timeIndex(t: number) {
        const stops = this.stops;
        const n = stops.length;
        if (n < 256) {
            for (let i = n; i-- > 0; ) {
Severity: Minor
Found in packages/ramp/src/ramp.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 varToHiccup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const varToHiccup = (
    { domain: [min, max], terms }: LVar<any>,
    opts: Partial<VizualizeVarOpts> = {}
) => {
    const {
Severity: Minor
Found in packages/fuzzy-viz/src/var.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 __wrapper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    <T>(update: Fn2<HTMLElement | SVGElement, T, void>) =>
    (tag: string, attribs?: any, body?: T) =>
        <WrappedComponent<T>>{
            async mount(parent: ParentNode, index: NumOrElement, state: T) {
                this.inner = $compile([tag, attribs]);
Severity: Minor
Found in packages/rdom/src/wrap.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 suffixes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    *suffixes(prefix: K, withPrefix = false, sep = "") {
        const node = this.find(prefix);
        if (node) {
            yield* node.keys(
                sep,
Severity: Minor
Found in packages/trie/src/multi-trie.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 __transform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const __transform = (real: NumericArray, img: NumericArray, n: number) => {
    let step = 1;
    let prevStep: number;
    let i: number, j: number, ii: number, ip: number;
    let tr: number, ti: number;
Severity: Minor
Found in packages/dsp/src/fft.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 concat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const concat = <T>(
    ...args: Nullable<ISeq<T> | ISeqable<T>>[]
): Maybe<ISeq<T>> => {
    const seqs: ISeq<T>[] = [];
    for (let i = 0, n = args.length; i < n; i++) {
Severity: Minor
Found in packages/seq/src/concat.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 broadcast has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const broadcast = async <T>(
    src: Channel<T>,
    dest: Channel<T>[],
    close = true
) => {
Severity: Minor
Found in packages/csp/src/ops.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 fromDense has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static fromDense(m: number, n: number, data: ArrayLike<number>) {
        const res = [];
        for (let i = 0, k = 0; i < m; i++) {
            for (let j = 0; j < n; j++, k++) {
                if (data[k] !== 0) {
Severity: Minor
Found in packages/sparse/src/coo.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 __outputRaw has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const __outputRaw = async (
    opts: OutputSpec,
    output: Sharp,
    ctx: ImgProcCtx,
    outDir: string
Severity: Minor
Found in packages/imago/src/ops/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 __readFloat has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const __readFloat = (iter: Iterator<number>) => {
    let i: IteratorResult<number>;
    let x: number;
    let acc = "";
    while (!(i = iter.next()).done) {
Severity: Minor
Found in packages/bencode/src/decode.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 __argAttribs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const __argAttribs = (args: any[]) => {
    if (args.length) {
        const last = args[args.length - 1];
        return isPlainObject(last)
            ? args.pop()
Severity: Minor
Found in packages/geom/src/internal/args.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 convolveClosed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const convolveClosed = (
    pts: ReadonlyVec[],
    kernel: number[],
    t = 0.5,
    iter = 1
Severity: Minor
Found in packages/geom-poly-utils/src/convolve.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 __equivMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const __equivMap = (a: Map<any, any>, b: any) => {
    if (a === b) {
        return true;
    }
    if (!(b instanceof Map) || a.size !== b.size) {
Severity: Minor
Found in packages/associative/src/internal/equiv.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 readPPM has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const readPPM = (
    src: Uint8Array,
    i: number,
    width: number,
    height: number,
Severity: Minor
Found in packages/pixel-io-netpbm/src/read.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 __argsVN has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const __argsVN = (args: any[]) => {
    const attr = __argAttribs(args);
    return args.length
        ? args.length === 2
            ? [args[0], args[1], attr]
Severity: Minor
Found in packages/geom/src/internal/args.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 (this === o) {
            return true;
        }
        if (!(o instanceof Set) || this.size !== o.size) {
Severity: Minor
Found in packages/sparse-set/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 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

Severity
Category
Status
Source
Language