thi-ng/umbrella

View on GitHub

Showing 378 of 1,891 total issues

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

    constructor(graph: IGraph<number>, cost: CostFn = () => 1) {
        const numV = (this.numV = graph.numVertices());
        const dist = (this.dist = new Float32Array(numV * numV).fill(Infinity));
        const next = (this.next = new Int32Array(numV * numV).fill(-1));
        for (let [u, v] of graph.edges()) {
Severity: Minor
Found in packages/adjacency/src/floyd-warshall.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 raf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const raf = (
    opts?: Partial<RAFOpts>
): ClosableAsyncGenerator<number> & IDeref<Maybe<number>> => {
    let frame = 0;
    let t0 = opts?.t0 || 0;
Severity: Minor
Found in packages/transducers-async/src/raf.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 __buildTransform has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const __buildTransform = (attribs: Attribs) => {
    const tx: string[] = [];
    let v: any;
    if ((v = attribs.translate)) {
        tx.push(isString(v) ? v : `translate(${ff(v[0])} ${ff(v[1])})`);
Severity: Minor
Found in packages/hiccup-svg/src/format.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 textFieldRaw has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

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

const __isEarHashed = (ear: Vertex) => {
    const { p: a, n: c } = ear;
    const b = ear;
    // reflex, can't be an ear
    if (__area(a!, b, c!) >= 0) return false;
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 earCut has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const earCut: Tessellator = (tess, faces, pids) => {
    let n = pids.length;
    const points = tess.pointsForIDs(pids);
    const order = [
        ...(polyArea2(points) > 0 ? range(n) : range(n - 1, -1, -1)),
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 serializeGraph has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const serializeGraph = (graph: Graph, isSub = false) => {
    const directed = graph.directed !== false;
    const acc = isSub
        ? [`subgraph ${graph.id || __nextSubgraphID()} {`]
        : [`${directed ? "di" : ""}graph ${graph.id || "g"} {`];
Severity: Minor
Found in packages/dot/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 simplify has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const simplify = (pts: Vec[], eps = 0, closed = false) => {
    let num = pts.length;
    const visited: boolean[] = [];
    if (num <= 2) return pts.slice();
    if (closed && !eqDelta(pts[0], pts[num - 1], EPS)) {
Severity: Minor
Found in packages/geom-resample/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 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 isOrthagonal has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Confirmed

export const isOrthagonal = (m: ReadonlyMat, n: number, eps = EPS) => {
    for (let i = 0; i < n; i++) {
        const ii = i * n;
        for (let j = 0; j < n; j++) {
            const jj = j * n;
Severity: Minor
Found in packages/matrices/src/orthagonal.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 dispatch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected dispatch(x: B) {
        LOGGER.debug(this.id, "dispatch", x);
        this.cacheLast && (this.last = x);
        const t = this.topicfn(x);
        if (t !== undefined) {
Severity: Minor
Found in packages/rstream/src/pubsub.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 intercept has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export function intercept<T>(
    interceptors: Interceptor<T>[] = [],
    src?: MaybeAsyncIterable<T>
) {
    if (src) return iterator1(intercept(interceptors), src);
Severity: Minor
Found in packages/transducers-async/src/intercept.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 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 __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 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

Severity
Category
Status
Source
Language