thi-ng/umbrella

View on GitHub

Showing 452 of 1,813 total issues

File emoji.ts has 1906 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Approx. 1900 emoji codes. Inverse mapping of {@link NAMES}, i.e. here the
 * emoji names are keys to look up the actual emoji characters in this object.
 *
 * @remarks
Severity: Major
Found in packages/emoji/src/emoji.ts - About 5 days to fix

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

export const MAXIMA4_CROSS: KernelFnSpec = {
    fn: (src) => {
        const {
            data: pix,
            stride: [stride, rowStride],
Severity: Major
Found in packages/pixel/src/convolve.ts and 1 other location - About 1 day to fix
packages/pixel/src/convolve.ts on lines 508..529

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 259.

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 MAXIMA4_DIAG: KernelFnSpec = {
    fn: (src) => {
        const {
            data: pix,
            stride: [stride, rowStride],
Severity: Major
Found in packages/pixel/src/convolve.ts and 1 other location - About 1 day to fix
packages/pixel/src/convolve.ts on lines 468..489

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 259.

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

Function stratifiedGrid3 has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

export function* stratifiedGrid3(opts: StratifiedGridOpts) {
    let { rnd, separation: sep } = {
        rnd: SYSTEM,
        separation: Math.SQRT1_2,
        ...opts,
Severity: Minor
Found in packages/poisson/src/stratified.ts - About 1 day 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

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

export declare class HSI implements TypedColor<HSI> {
    buf: NumericArray;
    offset: number;
    stride: number;
    h: number;
Severity: Major
Found in packages/color/src/hsi/hsi.ts and 6 other locations - About 1 day to fix
packages/color/src/hcy/hcy.ts on lines 11..33
packages/color/src/hsl/hsl.ts on lines 12..34
packages/color/src/hsv/hsv.ts on lines 12..34
packages/color/src/lch/lch.ts on lines 12..34
packages/color/src/oklab/oklab.ts on lines 12..34
packages/color/src/oklch/oklch.ts on lines 10..32

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 243.

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 7 locations. Consider refactoring.
Open

export declare class Oklch implements TypedColor<Oklch> {
    buf: NumericArray;
    offset: number;
    stride: number;
    l: number;
Severity: Major
Found in packages/color/src/oklch/oklch.ts and 6 other locations - About 1 day to fix
packages/color/src/hcy/hcy.ts on lines 11..33
packages/color/src/hsi/hsi.ts on lines 11..33
packages/color/src/hsl/hsl.ts on lines 12..34
packages/color/src/hsv/hsv.ts on lines 12..34
packages/color/src/lch/lch.ts on lines 12..34
packages/color/src/oklab/oklab.ts on lines 12..34

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 243.

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 7 locations. Consider refactoring.
Open

export declare class HCY implements TypedColor<HCY> {
    buf: NumericArray;
    offset: number;
    stride: number;
    h: number;
Severity: Major
Found in packages/color/src/hcy/hcy.ts and 6 other locations - About 1 day to fix
packages/color/src/hsi/hsi.ts on lines 11..33
packages/color/src/hsl/hsl.ts on lines 12..34
packages/color/src/hsv/hsv.ts on lines 12..34
packages/color/src/lch/lch.ts on lines 12..34
packages/color/src/oklab/oklab.ts on lines 12..34
packages/color/src/oklch/oklch.ts on lines 10..32

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 243.

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 7 locations. Consider refactoring.
Open

export declare class HSV implements TypedColor<HSV> {
    buf: NumericArray;
    offset: number;
    stride: number;
    h: number;
Severity: Major
Found in packages/color/src/hsv/hsv.ts and 6 other locations - About 1 day to fix
packages/color/src/hcy/hcy.ts on lines 11..33
packages/color/src/hsi/hsi.ts on lines 11..33
packages/color/src/hsl/hsl.ts on lines 12..34
packages/color/src/lch/lch.ts on lines 12..34
packages/color/src/oklab/oklab.ts on lines 12..34
packages/color/src/oklch/oklch.ts on lines 10..32

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 243.

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 7 locations. Consider refactoring.
Open

export declare class HSL implements TypedColor<HSL> {
    buf: NumericArray;
    offset: number;
    stride: number;
    h: number;
Severity: Major
Found in packages/color/src/hsl/hsl.ts and 6 other locations - About 1 day to fix
packages/color/src/hcy/hcy.ts on lines 11..33
packages/color/src/hsi/hsi.ts on lines 11..33
packages/color/src/hsv/hsv.ts on lines 12..34
packages/color/src/lch/lch.ts on lines 12..34
packages/color/src/oklab/oklab.ts on lines 12..34
packages/color/src/oklch/oklch.ts on lines 10..32

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 243.

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 class Plane implements IHiccupShape {
    constructor(
        public normal: Vec = [0, 1, 0],
        public w = 0,
        public attribs?: Attribs
Severity: Major
Found in packages/geom/src/api/plane.ts and 1 other location - About 6 hrs to fix
packages/geom/src/api/sphere.ts on lines 6..28

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 172.

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 class Sphere implements IHiccupShape {
    constructor(
        public pos: Vec = [0, 0, 0],
        public r = 1,
        public attribs?: Attribs
Severity: Major
Found in packages/geom/src/api/sphere.ts and 1 other location - About 6 hrs to fix
packages/geom/src/api/plane.ts on lines 6..28

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 172.

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

Function process has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

    protected async process() {
        if (!this.isBusy) {
            this.isBusy = true;
            const { buf, txbuf, reads, writes } = this;
            let doProcess: any = true;
Severity: Minor
Found in packages/csp/src/channel.ts - About 6 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 asGeometry has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

export const asGeometry = (
    src: Iterable<DrawCommand>,
    opts: Partial<AsGeometryOpts> = {}
) => {
    opts = {
Severity: Minor
Found in packages/geom-axidraw/src/as-geometry.ts - About 6 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

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

    if (interleave) {
        const { num, commands } = interleave;
        if (interleave.start !== false) yield* commands(0);
        for (let i = 0, n = pts.length; i < n; ) {
            yield* emitChunk(pts.slice(i, i + num));
Severity: Major
Found in packages/geom-axidraw/src/as-axidraw.ts and 1 other location - About 6 hrs to fix
packages/geom-axidraw/src/as-axidraw.ts on lines 121..132

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 158.

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

    if (interleave) {
        const { num, commands } = interleave;
        if (interleave.start !== false) yield* commands(0);
        for (let i = 0, n = children.length; i < n; ) {
            yield* emitChunk(children.slice(i, i + num));
Severity: Major
Found in packages/geom-axidraw/src/as-axidraw.ts and 1 other location - About 6 hrs to fix
packages/geom-axidraw/src/as-axidraw.ts on lines 163..174

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 158.

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

Function traceLines has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

export const traceLines = (
    opts: TraceOpts,
    order: Fn<GridIterOpts, Iterable<[number, number]>>,
    border: Predicate<[number, number]>,
    tx: PointTransform,
Severity: Minor
Found in packages/geom-trace-bitmap/src/trace.ts - About 6 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 _normalizeTree has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

const _normalizeTree = (
    tree: any,
    opts: Partial<HDOMOpts>,
    ctx: any,
    path: number[],
Severity: Minor
Found in packages/hdom/src/normalize.ts - About 5 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 C11 has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

export const C11 = (opts: Partial<C11Opts> = {}) => {
    const { typePrefix } = {
        typePrefix: "",
        ...opts,
    };
Severity: Minor
Found in packages/wasm-api-bindgen/src/c11.ts - About 5 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

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

export const isBefore = (
    i: Readonly<Interval>,
    x: number | Readonly<Interval>
) =>
    x instanceof Interval
Severity: Major
Found in packages/intervals/src/index.ts and 1 other location - About 4 hrs to fix
packages/intervals/src/index.ts on lines 296..306

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 132.

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 isAfter = (
    i: Readonly<Interval>,
    x: number | Readonly<Interval>
) =>
    x instanceof Interval
Severity: Major
Found in packages/intervals/src/index.ts and 1 other location - About 4 hrs to fix
packages/intervals/src/index.ts on lines 276..286

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 132.

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

Severity
Category
Status
Source
Language