thi-ng/umbrella

View on GitHub
packages/shader-ast/src/ast/ops.ts

Summary

Maintainability
D
3 days
Test Coverage

File ops.ts has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import type { IObjectOf } from "@thi.ng/api";
import { isNumber } from "@thi.ng/checks/is-number";
import type { Assign, Op1, Op2, Sym, Term } from "../api/nodes.js";
import type { ComparisonOperator, Operator } from "../api/ops.js";
import type {
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts - About 2 hrs to fix

Function op2 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Wontfix

export const op2 = (
    op: Operator,
    _l: Term<any> | number,
    _r: Term<any> | number,
    rtype?: Type,
Severity: Minor
Found in packages/shader-ast/src/ast/ops.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

Similar blocks of code found in 4 locations. Consider refactoring.
Invalid

export function addm<A extends UVec | "uint", B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericU, c: Term<C> | NumericU): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 3 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 320..320
packages/shader-ast/src/ast/ops.ts on lines 322..322
packages/shader-ast/src/ast/ops.ts on lines 338..338

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

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

export function madd<A extends UVec | "uint", B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericU, c: Term<C> | NumericU): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 3 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 320..320
packages/shader-ast/src/ast/ops.ts on lines 338..338
packages/shader-ast/src/ast/ops.ts on lines 340..340

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

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

export function madd<A extends IVec | "int", B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericI, c: Term<C> | NumericI): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 3 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 322..322
packages/shader-ast/src/ast/ops.ts on lines 338..338
packages/shader-ast/src/ast/ops.ts on lines 340..340

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

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

export function addm<A extends IVec | "int", B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericI, c: Term<C> | NumericI): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 3 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 320..320
packages/shader-ast/src/ast/ops.ts on lines 322..322
packages/shader-ast/src/ast/ops.ts on lines 340..340

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

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

export function addm<A extends Prim, B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericF, c: Term<C> | NumericF): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 2 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 318..318

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

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

export function madd<A extends Prim, B extends A, C extends B>(a: Term<A>, b: Term<B> | NumericF, c: Term<C> | NumericF): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 2 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 336..336

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

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

export function madd(a: Term<any>, b: Term<any> | number, c: Term<any> | number): Term<any> {
    return add(mul(<Term<any>>a, <any>b), <any>c);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 2 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 342..344

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

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

export function addm(a: Term<any>, b: Term<any> | number, c: Term<any> | number): Term<any> {
    return mul(add(<Term<any>>a, <any>b), <any>c);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 2 hrs to fix
packages/shader-ast/src/ast/ops.ts on lines 324..326

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

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

export function mulSelf<A extends Prim | Int | IVec | Mat, B extends A>(l: Sym<A>, r: Term<B>): Assign<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 142..142
packages/shader-ast/src/ast/ops.ts on lines 176..176
packages/shader-ast/src/ast/ops.ts on lines 257..257

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

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

export function divSelf<A extends Prim | Int | IVec | Mat, B extends A>(l: Sym<A>, r: Term<B>): Assign<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 142..142
packages/shader-ast/src/ast/ops.ts on lines 176..176
packages/shader-ast/src/ast/ops.ts on lines 223..223

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

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

export function subSelf<A extends Prim | Int | IVec | Mat, B extends A>(l: Sym<A>, r: Term<B>): Assign<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 142..142
packages/shader-ast/src/ast/ops.ts on lines 223..223
packages/shader-ast/src/ast/ops.ts on lines 257..257

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

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

export function addSelf<A extends Prim | Int | IVec | Mat, B extends A>(l: Sym<A>, r: Term<B>): Assign<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 176..176
packages/shader-ast/src/ast/ops.ts on lines 223..223
packages/shader-ast/src/ast/ops.ts on lines 257..257

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

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

export function add<A extends Prim | Int | IVec | Mat, B extends A>(l: Term<A>, r: Term<B>): Op2<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 156..156
packages/shader-ast/src/ast/ops.ts on lines 190..190
packages/shader-ast/src/ast/ops.ts on lines 237..237

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

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

export function sub<A extends Prim | Int | IVec | Mat, B extends A>(l: Term<A>, r: Term<B>): Op2<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 121..121
packages/shader-ast/src/ast/ops.ts on lines 190..190
packages/shader-ast/src/ast/ops.ts on lines 237..237

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

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

export function div<A extends Prim | Int | IVec | Mat, B extends A>(l: Term<A>, r: Term<B>): Op2<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 121..121
packages/shader-ast/src/ast/ops.ts on lines 156..156
packages/shader-ast/src/ast/ops.ts on lines 190..190

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

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

export function mul<A extends Prim | Int | IVec | Mat, B extends A>(l: Term<A>, r: Term<B>): Op2<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 121..121
packages/shader-ast/src/ast/ops.ts on lines 156..156
packages/shader-ast/src/ast/ops.ts on lines 237..237

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

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

export function bitxor<A extends Int | IVec | UVec, B extends A>(l: Term<A>, r: Term<B>): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 367..367
packages/shader-ast/src/ast/ops.ts on lines 382..382

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

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

export function bitand<A extends Int | IVec | UVec, B extends A>(l: Term<A>, r: Term<B>): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 382..382
packages/shader-ast/src/ast/ops.ts on lines 397..397

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

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

export function bitor<A extends Int | IVec | UVec, B extends A>(l: Term<A>, r: Term<B>): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 367..367
packages/shader-ast/src/ast/ops.ts on lines 397..397

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

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 function rshift<A extends IVec, B extends A>(l: Term<A>, r: Term<B> | IntTerm): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 419..419

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

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 function lshift<A extends IVec, B extends A>(l: Term<A>, r: Term<B> | IntTerm): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 436..436

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

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 function rshift<A extends UVec, B extends A>(l: Term<A>, r: Term<B> | UintTerm): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 421..421

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

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 function lshift<A extends UVec, B extends A>(l: Term<A>, r: Term<B> | UintTerm): Term<A>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 438..438

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

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

export function bitor(l: Term<any> | number, r: Term<any> | number): Op2<any> {
    return op2("|", l, r, undefined);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 377..379

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

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

export function bitand(l: Term<any> | number, r: Term<any> | number): Op2<any> {
    return op2("&", l, r, undefined);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 392..394

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

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 function sub(l: Term<any> | number, r: Term<any> | number): Op2<any> {
    return op2("-", l, r);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 252..254

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

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 function div(l: Term<any> | number, r: Term<any> | number): Op2<any> {
    return op2("/", l, r);
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 171..173

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

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

export function addSelf<T extends Vec | Mat>(l: Sym<T>, r: FloatTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function sub<T extends Vec | Mat>(l: Term<T>, r: FloatTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function div<T extends Vec | Mat>(l: Term<T>, r: FloatTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function divSelf<T extends Vec | Mat>(l: Sym<T>, r: FloatTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243

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

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

export function add<T extends Vec | Mat>(l: Term<T>, r: FloatTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function mul<T extends Vec | Mat>(l: Term<T>, r: FloatTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function mulSelf<T extends Vec | Mat>(l: Sym<T>, r: FloatTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 180..180
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function subSelf<T extends Vec | Mat>(l: Sym<T>, r: FloatTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 127..127
packages/shader-ast/src/ast/ops.ts on lines 146..146
packages/shader-ast/src/ast/ops.ts on lines 162..162
packages/shader-ast/src/ast/ops.ts on lines 196..196
packages/shader-ast/src/ast/ops.ts on lines 227..227
packages/shader-ast/src/ast/ops.ts on lines 243..243
packages/shader-ast/src/ast/ops.ts on lines 261..261

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

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

export function add<T extends Vec | Mat>(l: FloatTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 160..160
packages/shader-ast/src/ast/ops.ts on lines 194..194
packages/shader-ast/src/ast/ops.ts on lines 241..241

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

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

export function sub<T extends Vec | Mat>(l: FloatTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 125..125
packages/shader-ast/src/ast/ops.ts on lines 194..194
packages/shader-ast/src/ast/ops.ts on lines 241..241

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

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

export function mul<T extends Vec | Mat>(l: FloatTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 125..125
packages/shader-ast/src/ast/ops.ts on lines 160..160
packages/shader-ast/src/ast/ops.ts on lines 241..241

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

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

export function div<T extends Vec | Mat>(l: FloatTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 125..125
packages/shader-ast/src/ast/ops.ts on lines 160..160
packages/shader-ast/src/ast/ops.ts on lines 194..194

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

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

export const inc = <T extends Prim | Int>(t: Sym<T>): Op1<T> =>
    op1("++", t, true);
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 117..118

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

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

export const dec = <T extends Prim | Int>(t: Sym<T>): Op1<T> =>
    op1("--", t, true);
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 1 hr to fix
packages/shader-ast/src/ast/ops.ts on lines 114..115

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

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

export function mul<T extends UVec>(l: UintTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitor<T extends IVec>(l: Term<T>, r: IntTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitand<T extends UVec>(l: UintTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitand<T extends IVec>(l: Term<T>, r: IntTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitor<T extends UVec>(l: Term<T>, r: UintTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitxor<T extends UVec>(l: UintTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401

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

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

export function mul<T extends IVec>(l: Term<T>, r: IntTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function divSelf<T extends IVec>(l: Sym<T>, r: IntTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function sub<T extends UVec>(l: UintTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitxor<T extends IVec>(l: IntTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function add<T extends IVec>(l: Term<T>, r: IntTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function mulSelf<T extends IVec>(l: Sym<T>, r: IntTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function add<T extends UVec>(l: UintTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function mul<T extends IVec>(l: IntTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function div<T extends UVec>(l: UintTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function div<T extends IVec>(l: IntTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function subSelf<T extends IVec>(l: Sym<T>, r: IntTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitand<T extends UVec>(l: Term<T>, r: UintTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitxor<T extends IVec>(l: Term<T>, r: IntTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function addSelf<T extends IVec>(l: Sym<T>, r: IntTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function modi<T extends UVec>(l: UintTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function add<T extends UVec>(l: Term<T>, r: UintTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function div<T extends IVec>(l: Term<T>, r: IntTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function bitxor<T extends UVec>(l: Term<T>, r: UintTerm | number): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399

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

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

export function sub<T extends IVec>(l: IntTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitor<T extends IVec>(l: IntTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function sub<T extends IVec>(l: Term<T>, r: IntTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 281..281
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function modi<T extends IVec>(l: IntTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitand<T extends IVec>(l: IntTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function modi<T extends IVec>(l: Term<T>, r: IntTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 131..131
packages/shader-ast/src/ast/ops.ts on lines 135..135
packages/shader-ast/src/ast/ops.ts on lines 148..148
packages/shader-ast/src/ast/ops.ts on lines 166..166
packages/shader-ast/src/ast/ops.ts on lines 182..182
packages/shader-ast/src/ast/ops.ts on lines 200..200
packages/shader-ast/src/ast/ops.ts on lines 229..229
packages/shader-ast/src/ast/ops.ts on lines 247..247
packages/shader-ast/src/ast/ops.ts on lines 263..263
packages/shader-ast/src/ast/ops.ts on lines 369..369
packages/shader-ast/src/ast/ops.ts on lines 373..373
packages/shader-ast/src/ast/ops.ts on lines 384..384
packages/shader-ast/src/ast/ops.ts on lines 388..388
packages/shader-ast/src/ast/ops.ts on lines 399..399
packages/shader-ast/src/ast/ops.ts on lines 403..403

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

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

export function add<T extends IVec>(l: IntTerm | number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 390..390
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function bitor<T extends UVec>(l: UintTerm | number, r: Term<T>): Term<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 15 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 129..129
packages/shader-ast/src/ast/ops.ts on lines 133..133
packages/shader-ast/src/ast/ops.ts on lines 164..164
packages/shader-ast/src/ast/ops.ts on lines 168..168
packages/shader-ast/src/ast/ops.ts on lines 198..198
packages/shader-ast/src/ast/ops.ts on lines 202..202
packages/shader-ast/src/ast/ops.ts on lines 245..245
packages/shader-ast/src/ast/ops.ts on lines 249..249
packages/shader-ast/src/ast/ops.ts on lines 279..279
packages/shader-ast/src/ast/ops.ts on lines 283..283
packages/shader-ast/src/ast/ops.ts on lines 371..371
packages/shader-ast/src/ast/ops.ts on lines 375..375
packages/shader-ast/src/ast/ops.ts on lines 386..386
packages/shader-ast/src/ast/ops.ts on lines 401..401
packages/shader-ast/src/ast/ops.ts on lines 405..405

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

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

export function divSelf<T extends Int | "float">(l: Sym<T>, r: number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 144..144
packages/shader-ast/src/ast/ops.ts on lines 178..178
packages/shader-ast/src/ast/ops.ts on lines 225..225

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

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

export function addSelf<T extends Int | "float">(l: Sym<T>, r: number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 178..178
packages/shader-ast/src/ast/ops.ts on lines 225..225
packages/shader-ast/src/ast/ops.ts on lines 259..259

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

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

export function mulSelf<T extends Int | "float">(l: Sym<T>, r: number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 144..144
packages/shader-ast/src/ast/ops.ts on lines 178..178
packages/shader-ast/src/ast/ops.ts on lines 259..259

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

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

export function subSelf<T extends Int | "float">(l: Sym<T>, r: number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 55 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 144..144
packages/shader-ast/src/ast/ops.ts on lines 225..225
packages/shader-ast/src/ast/ops.ts on lines 259..259

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

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

const OP_INFO: IObjectOf<string> = {
    mave: "mv",
    vema: "vm",
    vefl: "vn",
    mafl: "vn",
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 55 mins to fix
packages/wasm-api-bindgen/src/c11.ts on lines 31..42

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

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

export function addSelf<T extends UVec>(l: Sym<T>, r: UintTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function sub<T extends UVec>(l: Term<T>, r: UintTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function modi<T extends UVec>(l: Term<T>, r: UintTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265

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

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

export function subSelf<T extends UVec>(l: Sym<T>, r: UintTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function div<T extends UVec>(l: Term<T>, r: UintTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function divSelf<T extends UVec>(l: Sym<T>, r: UintTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function mul<T extends UVec>(l: Term<T>, r: UintTerm | number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 231..231
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function mulSelf<T extends UVec>(l: Sym<T>, r: UintTerm | number): Assign<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 7 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 150..150
packages/shader-ast/src/ast/ops.ts on lines 170..170
packages/shader-ast/src/ast/ops.ts on lines 184..184
packages/shader-ast/src/ast/ops.ts on lines 204..204
packages/shader-ast/src/ast/ops.ts on lines 251..251
packages/shader-ast/src/ast/ops.ts on lines 265..265
packages/shader-ast/src/ast/ops.ts on lines 285..285

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

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

export function add<T extends Int | "float">(l: Term<T>, r: number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 158..158
packages/shader-ast/src/ast/ops.ts on lines 192..192
packages/shader-ast/src/ast/ops.ts on lines 239..239

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

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

export function sub<T extends Int | "float">(l: Term<T>, r: number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 123..123
packages/shader-ast/src/ast/ops.ts on lines 192..192
packages/shader-ast/src/ast/ops.ts on lines 239..239

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

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

export function div<T extends Int | "float">(l: Term<T>, r: number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 123..123
packages/shader-ast/src/ast/ops.ts on lines 158..158
packages/shader-ast/src/ast/ops.ts on lines 192..192

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

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

export function mul<T extends Int | "float">(l: Term<T>, r: number): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 123..123
packages/shader-ast/src/ast/ops.ts on lines 158..158
packages/shader-ast/src/ast/ops.ts on lines 239..239

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

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

export function addSelf(l: Sym<any>, r: Term<any> | number) {
    return assign(l, add(l, r));
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 185..187
packages/shader-ast/src/ast/ops.ts on lines 232..234

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

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

export function subSelf(l: Sym<any>, r: Term<any> | number) {
    return assign(l, sub(l, r));
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 151..153
packages/shader-ast/src/ast/ops.ts on lines 232..234

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

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

export function mulSelf(l: Sym<any>, r: Term<any> | number) {
    return assign(l, mul(l, r));
}
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 2 other locations - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 151..153
packages/shader-ast/src/ast/ops.ts on lines 185..187

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

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 function lshift(l: Term<any>, r: Term<any>): Op2<any> {
    return op2("<<", l, r, undefined);
}
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 441..443

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

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 function rshift(l: Term<any>, r: Term<any>): Op2<any> {
    return op2(">>", l, r, undefined);
}
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 50 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 424..426

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

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

export function sub<T extends Int | "float">(l: number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 45 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 122..122
packages/shader-ast/src/ast/ops.ts on lines 191..191
packages/shader-ast/src/ast/ops.ts on lines 238..238

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

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

export function mul<T extends Int | "float">(l: number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 45 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 122..122
packages/shader-ast/src/ast/ops.ts on lines 157..157
packages/shader-ast/src/ast/ops.ts on lines 238..238

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

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

export function add<T extends Int | "float">(l: number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 45 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 157..157
packages/shader-ast/src/ast/ops.ts on lines 191..191
packages/shader-ast/src/ast/ops.ts on lines 238..238

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

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

export function div<T extends Int | "float">(l: number, r: Term<T>): Op2<T>;
Severity: Major
Found in packages/shader-ast/src/ast/ops.ts and 3 other locations - About 45 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 122..122
packages/shader-ast/src/ast/ops.ts on lines 157..157
packages/shader-ast/src/ast/ops.ts on lines 191..191

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

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

    } else if (nr) {
        // (term, number)
        l = <Term<any>>_l;
        r = numberWithMatchingType(l, <number>_r);
        type = l.type;
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 40 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 78..83

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

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

        } else {
            // (number, term)
            r = <Term<any>>_r;
            l = numberWithMatchingType(r, <number>_l);
            type = r.type;
Severity: Minor
Found in packages/shader-ast/src/ast/ops.ts and 1 other location - About 40 mins to fix
packages/shader-ast/src/ast/ops.ts on lines 84..89

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

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

There are no issues that match your filters.

Category
Status