Microsoft/fast-dna

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

Summary

Maintainability
F
4 days
Test Coverage

File select.pw.spec.ts has 392 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { expect, test } from "@playwright/test";
import type { Locator, Page } from "@playwright/test";
import type { FASTListboxOption } from "../listbox-option/index.js";
import { fixtureURL } from "../__test__/helpers.js";
import type { FASTSelect } from "./select.js";
Severity: Minor
Found in packages/web-components/fast-foundation/src/select/select.pw.spec.ts - About 5 hrs to fix

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

        test("should set the `aria-disabled` attribute equal to the `disabled` value", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select disabled></fast-select>
                `;
    packages/web-components/fast-foundation/src/accordion-item/accordion-item.pw.spec.ts on lines 65..79
    packages/web-components/fast-foundation/src/slider-label/slider-label.pw.spec.ts on lines 38..52
    packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 127..141

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

    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-select");
    
    
    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/menu-item/menu-item.pw.spec.ts on lines 12..22
    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/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 set its value to the first enabled option when disabled", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select disabled>
                        <fast-option>Option 1</fast-option>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 78..92
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 120..134
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 136..150

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

    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 select the first option with a `selected` attribute when disabled", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select disabled>
                        <fast-option>Option 1</fast-option>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 78..92
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 104..118
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 120..134

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

    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 select the first option with a `selected` attribute", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select>
                        <fast-option>Option 1</fast-option>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 78..92
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 104..118
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 136..150

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

    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 set its value to the first enabled option", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select>
                        <fast-option>Option 1</fast-option>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 104..118
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 120..134
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 136..150

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

    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

                        element.evaluate(
                            (node, eventName) =>
                                Promise.race([
                                    new Promise(resolve =>
                                        node.addEventListener(eventName, () =>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 368..383

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

    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

                        element.evaluate(
                            (node, eventName) =>
                                Promise.race([
                                    new Promise(resolve =>
                                        node.addEventListener(eventName, () =>
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 305..320

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

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

        test("should NOT have a tabindex when `disabled` is true", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select disabled></fast-select>
                `;
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 170..178
    packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 88..96
    packages/web-components/fast-foundation/src/slider-label/slider-label.pw.spec.ts on lines 28..36
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 70..78
    packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts on lines 67..75
    packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 71..79
    packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 97..105

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

    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 return the same value when the `value` property is set before connect", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select value="Option 2">
                        <fast-option>Option 1</fast-option>
    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-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/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 have the attribute aria-expanded set to false", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select></fast-select>
                `;
    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-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 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 have a role of `combobox`", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select></fast-select>
                `;
    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-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 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 have a tabindex of 0 when `disabled` is not defined", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-select>
                        <fast-option>Option 1</fast-option>
    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-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 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