thi-ng/umbrella

View on GitHub
packages/geom/src/translate.ts

Summary

Maintainability
B
6 hrs
Test Coverage

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

        complexpoly: ($: ComplexPolygon, delta) =>
            new ComplexPolygon(
                translate($.boundary, delta),
                $.children.map((child) => translate(child, delta)),
                __copyAttribs($.attribs)
Severity: Major
Found in packages/geom/src/translate.ts and 4 other locations - About 1 hr to fix
packages/geom/src/rotate.ts on lines 90..95
packages/geom/src/scale.ts on lines 142..147
packages/geom/src/transform-vertices.ts on lines 124..129
packages/geom/src/transform.ts on lines 119..124

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

        rect: ($: Rect, delta) =>
            new Rect(
                add2([], $.pos, delta),
                set2([], $.size),
                __copyAttribs($.attribs)
Severity: Major
Found in packages/geom/src/translate.ts and 2 other locations - About 50 mins to fix
packages/geom/src/translate.ts on lines 86..91
packages/geom/src/translate.ts on lines 115..120

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

        ellipse: ($: Ellipse, delta) =>
            new Ellipse(
                add2([], $.pos, delta),
                set2([], $.r),
                __copyAttribs($.attribs)
Severity: Major
Found in packages/geom/src/translate.ts and 2 other locations - About 50 mins to fix
packages/geom/src/translate.ts on lines 86..91
packages/geom/src/translate.ts on lines 169..174

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

        aabb: ($: AABB, delta) =>
            new AABB(
                add3([], $.pos, delta),
                set3([], $.size),
                __copyAttribs($.attribs)
Severity: Major
Found in packages/geom/src/translate.ts and 2 other locations - About 50 mins to fix
packages/geom/src/translate.ts on lines 115..120
packages/geom/src/translate.ts on lines 169..174

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 7 locations. Consider refactoring.
Open

        circle: ($: Circle, delta) =>
            new Circle(add2([], $.pos, delta), $.r, __copyAttribs($.attribs)),
Severity: Major
Found in packages/geom/src/translate.ts and 6 other locations - About 30 mins to fix
packages/geom/src/rotate.ts on lines 83..88
packages/geom/src/rotate.ts on lines 138..143
packages/geom/src/translate.ts on lines 163..164
packages/geom/src/translate.ts on lines 166..167
packages/geom/src/translate.ts on lines 176..177
packages/geom/src/translate.ts on lines 179..180

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

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

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

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

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

Refactorings

Further Reading

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

        sphere: ($: Sphere, delta) =>
            new Sphere(add3([], $.pos, delta), $.r, __copyAttribs($.attribs)),
Severity: Major
Found in packages/geom/src/translate.ts and 6 other locations - About 30 mins to fix
packages/geom/src/rotate.ts on lines 83..88
packages/geom/src/rotate.ts on lines 138..143
packages/geom/src/translate.ts on lines 101..102
packages/geom/src/translate.ts on lines 163..164
packages/geom/src/translate.ts on lines 166..167
packages/geom/src/translate.ts on lines 179..180

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

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

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

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

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

Refactorings

Further Reading

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

        ray: ($: Ray, delta) =>
            new Ray(add2([], $.pos, delta), $.dir, __copyAttribs($.attribs)),
Severity: Major
Found in packages/geom/src/translate.ts and 6 other locations - About 30 mins to fix
packages/geom/src/rotate.ts on lines 83..88
packages/geom/src/rotate.ts on lines 138..143
packages/geom/src/translate.ts on lines 101..102
packages/geom/src/translate.ts on lines 166..167
packages/geom/src/translate.ts on lines 176..177
packages/geom/src/translate.ts on lines 179..180

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

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

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

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

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

Refactorings

Further Reading

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

        ray3: ($: Ray3, delta) =>
            new Ray3(add3([], $.pos, delta), $.dir, __copyAttribs($.attribs)),
Severity: Major
Found in packages/geom/src/translate.ts and 6 other locations - About 30 mins to fix
packages/geom/src/rotate.ts on lines 83..88
packages/geom/src/rotate.ts on lines 138..143
packages/geom/src/translate.ts on lines 101..102
packages/geom/src/translate.ts on lines 163..164
packages/geom/src/translate.ts on lines 176..177
packages/geom/src/translate.ts on lines 179..180

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

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

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

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

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

Refactorings

Further Reading

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

        text: ($: Text, delta) =>
            new Text(add2([], $.pos, delta), $.body, __copyAttribs($.attribs)),
Severity: Major
Found in packages/geom/src/translate.ts and 6 other locations - About 30 mins to fix
packages/geom/src/rotate.ts on lines 83..88
packages/geom/src/rotate.ts on lines 138..143
packages/geom/src/translate.ts on lines 101..102
packages/geom/src/translate.ts on lines 163..164
packages/geom/src/translate.ts on lines 166..167
packages/geom/src/translate.ts on lines 176..177

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

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