nexxtway/react-rainbow

View on GitHub
integration/specs/ButtonMenu/buttonMenu-5.spec.js

Summary

Maintainability
F
3 days
Test Coverage

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

    it('should move to the previous item when press arrow up', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const secondMenuItem = await buttonMenu.getItem(1);
        const thirdMenuItem = await buttonMenu.getItem(2);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 4 other locations - About 4 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 71..79
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 15..23
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 52..60
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 69..77

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

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('should move to the first item when last item is active and press arrow down', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const secondMenuItem = await buttonMenu.getItem(1);
        const thirdMenuItem = await buttonMenu.getItem(2);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 4 other locations - About 4 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 71..79
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 15..23
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 52..60
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 60..68

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

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 move to the next item when press arrow down', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const menuItem = await buttonMenu.getItem(1);
        await browser.keys('ArrowDown');
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 5 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 54..60
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 80..86
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 24..30
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 45..51
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 78..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 92.

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 move to the last item when first item is active and press arrow up', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const menuItem = await buttonMenu.getItem(4);
        await browser.keys('ArrowUp');
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 5 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 54..60
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 80..86
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 24..30
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 45..51
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 53..59

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

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('should close the menu when the menu is opened and click an element', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const menuItem = await buttonMenu.getItem(0);
        await menuItem.click();
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 4 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 93..99
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 31..37
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 38..44
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 91..97

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

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('should move focus to the item hovered', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const thirdMenuItem = await buttonMenu.getItem(2);
        await thirdMenuItem.hover();
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 4 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 93..99
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 31..37
integration/specs/ButtonMenu/buttonMenu-13.spec.js on lines 38..44
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 34..40

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

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 close the menu when the menu is opened and click outside of the menu', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const logoElement = await $(REACT_LOGO);
        await logoElement.click();
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 1 other location - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 21..27

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

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 set the focus to the first menu item when open the menu', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        const menuItem = await buttonMenu.getItem(0);
        await expect(await menuItem.hasFocus()).toBe(true);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 1 other location - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 48..53

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

    it('should close the menu when the menu is opened and press ESC', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        await browser.keys('Escape');
        await expect(await buttonMenu.isOpen()).toBe(false);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 7 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 28..33
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 42..47
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 87..92
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 100..105
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 41..46
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 85..90
integration/specs/InternalDropdown/internalDropdown-3.spec.js on lines 28..33

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

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

    it('should close the menu when the menu is opened and press the key "tab"', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        await browser.keys('Tab');
        await expect(await buttonMenu.isOpen()).toBe(false);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 7 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 28..33
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 42..47
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 87..92
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 100..105
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 28..33
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 41..46
integration/specs/InternalDropdown/internalDropdown-3.spec.js on lines 28..33

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

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

    it('should put the menu button focused when the menu is opened and press ESC', async () => {
        const buttonMenu = new PageButtonMenu(MENU_BTN);
        await buttonMenu.click();
        await browser.keys('Escape');
        await expect(await buttonMenu.hasFocusButton()).toBe(true);
Severity: Major
Found in integration/specs/ButtonMenu/buttonMenu-5.spec.js and 7 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 28..33
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 42..47
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 87..92
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 100..105
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 28..33
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 85..90
integration/specs/InternalDropdown/internalDropdown-3.spec.js on lines 28..33

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

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