Microsoft/fast-dna

View on GitHub
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts

Summary

Maintainability
F
4 days
Test Coverage

FIXME found
Open

                // FIXME: Playwright's keyboard API is not working as expected.

FIXME found
Open

                // FIXME: Playwright's keyboard API is not working as expected.

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

        test("should emit a `keydown` event when space key is invoked", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-menu-item>Menu item</fast-menu-item>
                `;
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 179..202

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

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

        test("should emit a `keydown` event when `Enter` key is invoked", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-menu-item>Menu item</fast-menu-item>
                `;
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 154..177

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

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

    test("should set the `aria-checked` attribute of radio item to true when clicked", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item role="menuitemradio">Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 97..113

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

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

    test("should toggle the `aria-checked` attribute of checkbox item when clicked", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item role="menuitemcheckbox">Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 115..131

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

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

    test.beforeAll(async ({ browser }) => {
        page = await browser.newPage();

        element = page.locator("fast-menu-item");

packages/web-components/fast-foundation/src/accordion/accordion.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/anchored-region/anchored-region.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/breadcrumb/breadcrumb.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/calendar/calendar.pw.spec.ts on lines 12..22
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 15..25
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 13..23
packages/web-components/fast-foundation/src/divider/divider.pw.spec.ts on lines 12..22
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/listbox-option/listbox-option.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 10..20
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 12..22
packages/web-components/fast-foundation/src/slider-label/slider-label.pw.spec.ts on lines 12..22
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 15..25
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 10..20
packages/web-components/fast-foundation/src/toolbar/toolbar.pw.spec.ts on lines 11..21
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 11..21

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

    test("should include a role of `menuitem` by default when no role is provided", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item>Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/accordion/accordion.pw.spec.ts on lines 27..44
packages/web-components/fast-foundation/src/accordion/accordion.pw.spec.ts on lines 46..63
packages/web-components/fast-foundation/src/divider/divider.pw.spec.ts on lines 28..36

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

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

    test("should set an `aria-expanded` attribute with the `expanded` value when provided", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item expanded>Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/breadcrumb-item/breadcrumb-item.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/breadcrumb/breadcrumb.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/checkbox/checkbox.pw.spec.ts on lines 30..37
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 61..69
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 29..37
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 39..50
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 34..42
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 44..52
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 54..62
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 55..65
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 67..77
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 79..87
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/listbox-option/listbox-option.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 30..42
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 57..65
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 77..85
packages/web-components/fast-foundation/src/menu/menu.pw.spec.ts on lines 30..40
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 338..346
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 32..40
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 106..114
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 138..146
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 78..86
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 134..142
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 105..113
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 115..123
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 28..36
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 38..50
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 68..76
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 152..164
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 31..38
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 50..58
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 60..68
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 47..55
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 57..65
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 202..210
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 101..109
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 111..119
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 165..173
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 190..198
packages/web-components/fast-foundation/src/tree-view/tree-view.pw.spec.ts on lines 27..35

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

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

    test("should set the `aria-disabled` attribute with the `disabled` value when provided", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item disabled>Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/breadcrumb-item/breadcrumb-item.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/breadcrumb/breadcrumb.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/checkbox/checkbox.pw.spec.ts on lines 30..37
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 61..69
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 29..37
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 39..50
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 34..42
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 44..52
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 54..62
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 55..65
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 67..77
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 79..87
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/listbox-option/listbox-option.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 30..42
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 67..75
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 77..85
packages/web-components/fast-foundation/src/menu/menu.pw.spec.ts on lines 30..40
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 338..346
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 32..40
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 106..114
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 138..146
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 78..86
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 134..142
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 105..113
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 115..123
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 28..36
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 38..50
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 68..76
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 152..164
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 31..38
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 50..58
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 60..68
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 47..55
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 57..65
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 202..210
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 101..109
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 111..119
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 165..173
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 190..198
packages/web-components/fast-foundation/src/tree-view/tree-view.pw.spec.ts on lines 27..35

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

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

    test("should set an `aria-checked` attribute with the `checked` value when provided to a menuitemcheckbox", async () => {
        await root.evaluate(node => {
            node.innerHTML = /* html */ `
                <fast-menu-item role="menuitemcheckbox" checked>Menu item</fast-menu-item>
            `;
packages/web-components/fast-foundation/src/breadcrumb-item/breadcrumb-item.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/breadcrumb/breadcrumb.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/checkbox/checkbox.pw.spec.ts on lines 30..37
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/data-grid/data-grid-cell.pw.spec.ts on lines 61..69
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 29..37
packages/web-components/fast-foundation/src/data-grid/data-grid-row.pw.spec.ts on lines 39..50
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 34..42
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 44..52
packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 54..62
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 55..65
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 67..77
packages/web-components/fast-foundation/src/dialog/dialog.pw.spec.ts on lines 79..87
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/flipper/flipper.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/listbox-option/listbox-option.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 30..42
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 57..65
packages/web-components/fast-foundation/src/menu-item/menu-item.pw.spec.ts on lines 67..75
packages/web-components/fast-foundation/src/menu/menu.pw.spec.ts on lines 30..40
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 338..346
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/progress-ring/progress-ring.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 31..39
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 41..49
packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 51..59
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 32..40
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 106..114
packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 138..146
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 78..86
packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 134..142
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 105..113
packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 115..123
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 28..36
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 38..50
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 68..76
packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 152..164
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 31..38
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 50..58
packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 60..68
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 37..45
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 47..55
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 57..65
packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 202..210
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 26..34
packages/web-components/fast-foundation/src/tab-panel/tab-panel.pw.spec.ts on lines 36..44
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 46..54
packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts on lines 56..64
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 101..109
packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 111..119
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 27..35
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 165..173
packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 190..198
packages/web-components/fast-foundation/src/tree-view/tree-view.pw.spec.ts on lines 27..35

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

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