packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js

Summary

Maintainability
F
5 days
Test Coverage

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

        it('moves last three items to 1st position', () => {
            props.highlightedItemIds = [items[3].id, items[4].id, items[5].id]
            props.draggableId = items[4].id
            props.sourceIndex = 4
            props.destinationIndex = 0
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 125..134

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

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

        it('moves first three items to 2nd position', () => {
            props.highlightedItemIds = [items[0].id, items[1].id, items[2].id]
            props.draggableId = items[1].id
            props.sourceIndex = 0
            props.destinationIndex = 4
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 152..161

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

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

        it('moves first two items to 3rd position', () => {
            props.highlightedItemIds = [items[0].id, items[1].id]
            props.draggableId = items[0].id
            props.sourceIndex = 0
            props.destinationIndex = 4
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 81..90
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 92..101
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 103..112
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 114..123

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

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

        it('moves first two items to last position', () => {
            props.highlightedItemIds = [items[0].id, items[1].id]
            props.draggableId = items[0].id
            props.sourceIndex = 0
            props.destinationIndex = 6
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 70..79
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 81..90
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 103..112
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 114..123

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

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

        it('moves last two items to 3rd position', () => {
            props.highlightedItemIds = [items[4].id, items[5].id]
            props.draggableId = items[4].id
            props.sourceIndex = 5
            props.destinationIndex = 2
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 70..79
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 81..90
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 92..101
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 114..123

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

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

        it('moves first two items to 5th (2nd to last) position', () => {
            props.highlightedItemIds = [items[0].id, items[1].id]
            props.draggableId = items[0].id
            props.sourceIndex = 0
            props.destinationIndex = 5
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 70..79
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 92..101
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 103..112
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 114..123

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

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

        it('moves second and sixth items to 4th position', () => {
            props.highlightedItemIds = [items[1].id, items[5].id]
            props.draggableId = items[1].id
            props.sourceIndex = 1
            props.destinationIndex = 4
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 70..79
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 81..90
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 92..101
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 103..112

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

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

        it('moves 1st item to 5th position', () => {
            props.highlightedItemIds = [items[0].id]
            props.draggableId = items[0].id
            props.sourceIndex = 0
            props.destinationIndex = 4
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 53..62

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

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

        it('moves last item to 3rd position', () => {
            props.highlightedItemIds = [items[5].id]
            props.draggableId = items[5].id
            props.sourceIndex = 5
            props.destinationIndex = 2
packages/period-selector-dialog/src/ItemSelector/modules/__tests__/reorderList.spec.js on lines 42..51

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

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