nexxtway/react-rainbow

View on GitHub
integration/specs/AvatarMenu/avatarMenu-1.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 first item when last item is active and press arrow down', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const firstMenuItem = await avatarMenu.getItem(0);
        const lastMenuItem = await avatarMenu.getItem(1);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 4 other locations - About 4 hrs to fix
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
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 6 locations. Consider refactoring.
Open

    it('should move to the last item when first item is active and press arrow up', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const lastMenuItem = await avatarMenu.getItem(1);
        await browser.keys('ArrowUp');
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 5 other locations - About 2 hrs to fix
integration/specs/AvatarMenu/avatarMenu-1.spec.js on lines 54..60
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
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 next item when press arrow down', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const menuItem = await avatarMenu.getItem(1);
        await browser.keys('ArrowDown');
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 5 other locations - About 2 hrs to fix
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
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 5 locations. Consider refactoring.
Open

    it('should move focus to the item hovered', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const menuItem = await avatarMenu.getItem(1);
        await menuItem.hover();
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 4 other locations - About 2 hrs to fix
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
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 2 locations. Consider refactoring.
Open

    it('should close the menu when the menu is opened and click outside of the menu', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const logoElement = await $(REACT_LOGO);
        await logoElement.click();
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 1 other location - About 2 hrs to fix
integration/specs/ButtonMenu/buttonMenu-5.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 avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        const menuItem = await avatarMenu.getItem(0);
        await expect(await menuItem.hasFocus()).toBe(true);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 1 other location - About 2 hrs to fix
integration/specs/ButtonMenu/buttonMenu-5.spec.js on lines 47..52

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 avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        await browser.keys('Escape');
        await expect(await avatarMenu.isOpen()).toBe(false);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.spec.js and 7 other locations - About 2 hrs to fix
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/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 not have focus in the trigger AvatarMenu button when the menu is opened and press the tab key', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        await browser.keys('Tab');
        await expect(await avatarMenu.hasFocusButton()).toBe(false);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.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/ButtonMenu/buttonMenu-5.spec.js on lines 28..33
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 avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        await browser.keys('Tab');
        await expect(await avatarMenu.isOpen()).toBe(false);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.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 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/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 put the AvatarMenu button focused when the menu is opened and press ESC', async () => {
        const avatarMenu = new PageAvatarMenu(AVATAR_MENU);
        await avatarMenu.click();
        await browser.keys('Escape');
        await expect(await avatarMenu.hasFocusButton()).toBe(true);
Severity: Major
Found in integration/specs/AvatarMenu/avatarMenu-1.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 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/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