thi-ng/umbrella

View on GitHub

Showing 378 of 1,891 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const meldDeepObj = (
    dest: IObjectOf<any>,
    ...objects: Nullable<IObjectOf<any>>[]
): any =>
    meldObjWith(
Severity: Major
Found in packages/object-utils/src/merge-deep.ts and 1 other location - About 2 hrs to fix
packages/object-utils/src/merge-deep.ts on lines 5..14

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const mergeDeepObj = (
    dest: IObjectOf<any>,
    ...objects: Nullable<IObjectOf<any>>[]
): any =>
    mergeObjWith(
Severity: Major
Found in packages/object-utils/src/merge-deep.ts and 1 other location - About 2 hrs to fix
packages/object-utils/src/merge-deep.ts on lines 16..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export interface SliderGroupOpts
    extends Omit<SliderOpts, "layout" | "value" | "label" | "info"> {
    layout: IGridLayout<any>;
    /**
     * If true (default: false), the sliders will be arranged horizontally.
Severity: Major
Found in packages/imgui/src/components/sliderh.ts and 1 other location - About 2 hrs to fix
packages/imgui/src/components/ring.ts on lines 76..86

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export interface RingGroupOpts
    extends Omit<RingOpts, "layout" | "value" | "label" | "info"> {
    layout: IGridLayout<any>;
    /**
     * If true (default), the controls will be arranged horizontally.
Severity: Major
Found in packages/imgui/src/components/ring.ts and 1 other location - About 2 hrs to fix
packages/imgui/src/components/sliderh.ts on lines 57..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File target.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

import type { Fn } from "@thi.ng/api";
import { isBoolean } from "@thi.ng/checks/is-boolean";
import { isNumber } from "@thi.ng/checks/is-number";
import { unsupported } from "@thi.ng/errors/unsupported";
import type {
Severity: Minor
Found in packages/shader-ast-js/src/target.ts - About 2 hrs to fix

Function formatPath has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const formatPath = (
    path: string,
    ctx: ImgProcCtx,
    spec: OutputSpec,
    buf: Buffer | TypedArray
Severity: Minor
Found in packages/imago/src/path.ts - About 2 hrs 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 source has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const source = <T>(
    initial?: T,
    buffer: IReadWriteBuffer<Maybe<T>> | number = 1
) => {
    const queue = isNumber(buffer) ? fifo<Maybe<T>>(buffer) : buffer;
Severity: Minor
Found in packages/transducers-async/src/source.ts - About 2 hrs 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 __fieldType has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const __fieldType = (
    f: Field,
    coll: TypeColl,
    opts: CodeGenOpts,
    prefix: string
Severity: Minor
Found in packages/wasm-api-bindgen/src/c11.ts - About 2 hrs 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 __formatCond has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const __formatCond = (cond: any) => {
    if (isString(cond)) {
        return cond;
    }
    const acc = [];
Severity: Minor
Found in packages/hiccup-css/src/conditional.ts - About 2 hrs 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 createTree has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const createTree = <T>(
    opts: Partial<HDOMOpts>,
    impl: HDOMImplementation<T>,
    parent: T,
    tree: any,
Severity: Minor
Found in packages/hdom/src/dom.ts - About 2 hrs 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

File api.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { Fn, Predicate } from "@thi.ng/api";
import type {
    Attribs,
    FormAttribs,
    InputAttribs,
Severity: Minor
Found in packages/rdom-forms/src/api.ts - About 2 hrs to fix

Function smoothTangents has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export const smoothTangents = (
    pts: ReadonlyVec[],
    close = false,
    proportional = true,
    scale = 1
Severity: Minor
Found in packages/geom-poly-utils/src/tangent.ts - About 2 hrs 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 sidechain has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export async function* sidechain<T>(
    src: AsyncIterable<T>,
    side: AsyncIterable<any>,
    opts?: Partial<SidechainOpts>
) {
Severity: Minor
Found in packages/transducers-async/src/sidechain.ts - About 2 hrs 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 classifyField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export const classifyField = (
    field: Pick<Field, "type" | "tag" | "len" | "const" | "sentinel" | "pad">,
    coll: TypeColl
): { classifier: FieldClass; isConst: boolean } => {
    if (isPadding(field)) return { classifier: "pad", isConst: false };
Severity: Minor
Found in packages/wasm-api-bindgen/src/internal/classify.ts - About 2 hrs 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 __makeField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const __makeField = (
    field: Field,
    obj: any,
    dv: DataView,
    bitOffset: number,
Severity: Minor
Found in packages/unionstruct/src/index.ts - About 2 hrs 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 __expandVar has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const __expandVar = async (
    { children }: ParseScope<string>,
    ctx: GeneratorContext
) => {
    const id = __resolveVarName(children![0].result, ctx);
Severity: Minor
Found in packages/proctext/src/generate.ts - About 2 hrs 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

File api.ts has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type {
    Fn,
    Fn3,
    IObjectOf,
    Keys,
Severity: Minor
Found in packages/imago/src/api.ts - About 2 hrs to fix

BitMatrix has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class BitMatrix implements IClear, ICopy<BitMatrix> {
    /** Backing byte array */
    data: Uint8Array;
    /** Number of bytes per row */
    stride: number;
Severity: Minor
Found in packages/bitfield/src/bitmatrix.ts - About 2 hrs to fix

BitField has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class BitField implements IClear, ICopy<BitField>, ILength {
    /** Backing byte array */
    data: Uint8Array;
    /** Field size in bits (always a multiple of 8) */
    n: number;
Severity: Minor
Found in packages/bitfield/src/bitfield.ts - About 2 hrs to fix

Transacted has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export class Transacted<T> implements IAtom<T> {
    parent: IAtom<T>;
    current: Maybe<T>;
    protected id: string;
    protected isActive: boolean;
Severity: Minor
Found in packages/atom/src/transacted.ts - About 2 hrs to fix
Severity
Category
Status
Source
Language