nexxtway/react-rainbow

View on GitHub
integration/specs/Calendar/calendar-1.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    it('should focus the right day in current month when an arrow key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await expect(await calendar.isDayFocused(11)).toBe(true);
        await browser.keys('ArrowUp');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 2 other locations - About 1 day to fix
integration/specs/Calendar/calendar-9.spec.js on lines 37..49
integration/specs/Calendar/calendar-9.spec.js on lines 50..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 226.

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('should move from calendar controls to days when TAB key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickPrevMonthButton();
        await expect(await calendar.isDayFocused(1)).toBe(false);
        await browser.keys('Tab');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 5 hrs to fix
integration/specs/Calendar/calendar-9.spec.js on lines 200..208

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

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('should change to the previous year when ALT + PAGEUP keys are pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys(['Alt', 'PageUp']);
        await expect(await calendar.getSelectedMonth()).toBe('December');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 144..151

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

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('should change to next year when ALT + PAGEDOWN keys are pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys(['Alt', 'PageDown']);
        await expect(await calendar.getSelectedMonth()).toBe('December');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 136..143

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

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('should change month when is in the first week of a month, the first day of the month is not the first day of the week and press HOME key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickPrevMonthButton();
        await calendar.clickPrevMonthButton();
        await calendar.clickDay(4);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 85..93

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

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('should change month when is in the last week of a month, the last day of the month is not the last day of the week and press END key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickPrevMonthButton();
        await calendar.clickPrevMonthButton();
        await calendar.clickDay(29);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 4 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 76..84

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

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

    it('should change to next month when PAGEDOWN key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys('PageDown');
        await expect(await calendar.getSelectedMonth()).toBe('January');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 3 other locations - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 62..68
integration/specs/Calendar/calendar-1.spec.js on lines 69..75
integration/specs/Calendar/calendar-1.spec.js on lines 108..114

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

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

    it('should change to the previous month when is in the first day of a month and press LEFT OR UP arrow keys', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(1);
        await browser.keys('ArrowLeft');
        await expect(await calendar.getSelectedMonth()).toBe('November');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 3 other locations - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 69..75
integration/specs/Calendar/calendar-1.spec.js on lines 108..114
integration/specs/Calendar/calendar-1.spec.js on lines 115..121

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

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

    it('should change to next month when is in the last day of a month and press RIGHT OR DOWN arrow keys', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(31);
        await browser.keys('ArrowRight');
        await expect(await calendar.getSelectedMonth()).toBe('January');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 3 other locations - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 62..68
integration/specs/Calendar/calendar-1.spec.js on lines 108..114
integration/specs/Calendar/calendar-1.spec.js on lines 115..121

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

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

    it('should change to the previous month when PAGEUP key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys('PageUp');
        await expect(await calendar.getSelectedMonth()).toBe('November');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 3 other locations - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 62..68
integration/specs/Calendar/calendar-1.spec.js on lines 69..75
integration/specs/Calendar/calendar-1.spec.js on lines 115..121

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

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('should change year when is in the first week of January and the day 1 is not the fisrt day of the week and press HOME key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickNextMonthButton();
        calendar.setYear('2019');
        await calendar.clickDay(2);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 122..129

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

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('should change to the previous year when is in January and PAGEUP key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickNextMonthButton();
        calendar.setYear('2019');
        await calendar.clickDay(11);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 3 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 94..101

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

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

    it('should focus the last day of the week when END key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys('End');
        await expect(await calendar.isDayFocused(14)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 5 other locations - About 2 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 50..55
integration/specs/Calendar/calendar-9.spec.js on lines 63..68
integration/specs/Calendar/calendar-9.spec.js on lines 69..74
integration/specs/Calendar/calendar-9.spec.js on lines 75..80
integration/specs/Calendar/calendar-9.spec.js on lines 81..86

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

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

    it('should focus the first day of the week when HOME key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys('Home');
        await expect(await calendar.isDayFocused(8)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 5 other locations - About 2 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 56..61
integration/specs/Calendar/calendar-9.spec.js on lines 63..68
integration/specs/Calendar/calendar-9.spec.js on lines 69..74
integration/specs/Calendar/calendar-9.spec.js on lines 75..80
integration/specs/Calendar/calendar-9.spec.js on lines 81..86

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

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('should change to next year when is in the December and PAGEDOWN key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(11);
        await browser.keys('PageDown');
        await expect(await calendar.getSelectedYear()).toBe('2020');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 2 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 102..107

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

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('should change year when is in the last week of December and the 31 is not the last day of the week and press END key', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickDay(31);
        await browser.keys('End');
        await expect(await calendar.getSelectedYear()).toBe('2020');
Severity: Major
Found in integration/specs/Calendar/calendar-1.spec.js and 1 other location - About 2 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 130..135

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

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