nexxtway/react-rainbow

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

Summary

Maintainability
F
1 wk
Test Coverage

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

    it('should focus the correct day in left month when an arrow key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickLeftMonthDay(11);
        await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true);
        await browser.keys('ArrowUp');
Severity: Major
Found in integration/specs/Calendar/calendar-9.spec.js and 2 other locations - About 1 day to fix
integration/specs/Calendar/calendar-1.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 3 locations. Consider refactoring.
Open

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

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

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

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.clickLeftMonthDay(11);
        await browser.keys(['Alt', 'PageUp']);
        await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.spec.js and 1 other location - About 7 hrs to fix
integration/specs/Calendar/calendar-9.spec.js on lines 162..171

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

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 month when PAGEUP key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickRightMonthDay(11);
        await browser.keys('PageUp');
        await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.spec.js and 1 other location - About 6 hrs to fix
integration/specs/Calendar/calendar-9.spec.js on lines 117..126

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

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 month when PAGEDOWN key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickLeftMonthDay(11);
        await browser.keys('PageDown');
        await expect(await calendar.isRightMonthDayFocused(11)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.spec.js and 1 other location - About 6 hrs to fix
integration/specs/Calendar/calendar-9.spec.js on lines 107..116

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

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.isLeftMonthDayFocused(1)).toBe(false);
        await browser.keys('Tab');
Severity: Major
Found in integration/specs/Calendar/calendar-9.spec.js and 1 other location - About 5 hrs to fix
integration/specs/Calendar/calendar-1.spec.js on lines 199..207

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

    it('should focus the first day of the week in right month when HOME key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickRightMonthDay(11);
        await browser.keys('Home');
        await expect(await calendar.isRightMonthDayFocused(5)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.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-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 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 in left month when HOME key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickLeftMonthDay(11);
        await browser.keys('Home');
        await expect(await calendar.isLeftMonthDayFocused(8)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.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-1.spec.js on lines 56..61
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 last day of the week in left month when END key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickLeftMonthDay(11);
        await browser.keys('End');
        await expect(await calendar.isLeftMonthDayFocused(14)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.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-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 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 last day of the week in right month when END key is pressed', async () => {
        const calendar = await PageCalendar(CALENDAR);
        await calendar.clickRightMonthDay(8);
        await browser.keys('End');
        await expect(await calendar.isRightMonthDayFocused(11)).toBe(true);
Severity: Major
Found in integration/specs/Calendar/calendar-9.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-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

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

There are no issues that match your filters.

Category
Status