averias/redis-time-series

View on GitHub
src/__tests__/unit/builder/requestParamsBuilder.test.ts

Summary

Maintainability
A
30 mins
Test Coverage

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

test("add retention", () => {
    expect(builder.addRetention(1000).get()).toEqual([CommandKeyword.RETENTION, 1000]);
});
Severity: Minor
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 1 other location - About 45 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 90..92

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

test("add count", () => {
    expect(builder.addCount(7).get()).toEqual([CommandKeyword.COUNT, 7]);
});
Severity: Minor
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 1 other location - About 45 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 34..36

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

test("add empty samples", () => {
    expect(builder.addSamples([]).get().length).toEqual(0);
});
Severity: Minor
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 2 other locations - About 40 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 53..55
src/__tests__/unit/builder/requestParamsDirector.test.ts on lines 176..178

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

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

test("add empty labels", () => {
    expect(builder.addLabels([]).get().length).toEqual(0);
});
Severity: Minor
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 2 other locations - About 40 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 71..73
src/__tests__/unit/builder/requestParamsDirector.test.ts on lines 176..178

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

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

test("add keys", () => {
    expect(builder.addKeys("source", "target").get()).toEqual(["source", "target"]);
});
Severity: Minor
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 1 other location - About 35 mins to fix
src/__tests__/unit/builder/requestParamsDirector.test.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 47.

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

test("add no aggregation", () => {
    expect(builder.addAggregation().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 38..40
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 57..59
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 94..96
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 136..138
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 150..152

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

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

test("add no count", () => {
    expect(builder.addCount().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 38..40
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 57..59
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 107..109
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 136..138
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 150..152

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

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

test("add no retention", () => {
    expect(builder.addRetention().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 57..59
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 94..96
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 107..109
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 136..138
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 150..152

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

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

test("add no labels", () => {
    expect(builder.addLabels().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 38..40
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 94..96
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 107..109
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 136..138
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 150..152

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

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

test("add no range", () => {
    expect(builder.addRange().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 38..40
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 57..59
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 94..96
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 107..109
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 150..152

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

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

test("reset", () => {
    expect(builder.reset().get().length).toEqual(0);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 5 other locations - About 35 mins to fix
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 38..40
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 57..59
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 94..96
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 107..109
src/__tests__/unit/builder/requestParamsBuilder.test.ts on lines 136..138

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

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

test("add key", () => {
    expect(builder.addKey("key").get()).toEqual(["key"]);
});
Severity: Major
Found in src/__tests__/unit/builder/requestParamsBuilder.test.ts and 3 other locations - About 30 mins to fix
src/__tests__/unit/builder/requestParamsDirector.test.ts on lines 68..70
src/__tests__/unit/builder/requestParamsDirector.test.ts on lines 109..111
src/__tests__/unit/builder/requestParamsDirector.test.ts on lines 346..348

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