Microsoft/fast-dna

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

Summary

Maintainability
F
5 days
Test Coverage

File radio-group.pw.spec.ts has 350 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { expect, test } from "@playwright/test";
import type { Locator, Page } from "@playwright/test";
import type { FASTRadio } from "../radio/index.js";
import { fixtureURL } from "../__test__/helpers.js";
import { RadioGroupOrientation } from "./radio-group.options.js";

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

        test("should set the `aria-readonly` attribute equal to the `readonly` property", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 116..136
    packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 143..163

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        test("should set the `aria-disabled` attribute equal to the `disabled` property", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 148..168
    packages/web-components/fast-foundation/src/tree-item/tree-item.pw.spec.ts on lines 143..163

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        test("should set the `aria-orientation` attribute equal to the `orientation` value", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 135..159
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 161..179

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

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

        test.beforeAll(async ({ browser }) => {
            page = await browser.newPage();
    
            element = page.locator("fast-radio-group");
    
    
    packages/web-components/fast-foundation/src/breadcrumb-item/breadcrumb-item.pw.spec.ts on lines 13..25
    packages/web-components/fast-foundation/src/button/button.pw.spec.ts on lines 13..25
    packages/web-components/fast-foundation/src/checkbox/checkbox.pw.spec.ts on lines 12..24
    packages/web-components/fast-foundation/src/disclosure/disclosure.pw.spec.ts on lines 13..25
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 12..24
    packages/web-components/fast-foundation/src/menu/menu.pw.spec.ts on lines 12..24
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 13..25
    packages/web-components/fast-foundation/src/search/search.pw.spec.ts on lines 13..25
    packages/web-components/fast-foundation/src/text-area/text-area.pw.spec.ts on lines 13..25

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

    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 a default `aria-orientation` value when `orientation` is not defined", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 80..91

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

    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 set a default `aria-disabled` value when `disabled` is not defined", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/radio/radio.pw.spec.ts on lines 88..96
    packages/web-components/fast-foundation/src/select/select.pw.spec.ts on lines 94..102
    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 set the `aria-readonly` attribute when the `readonly` attribute is present", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group readonly></fast-radio-group>
                `;
    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/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 when disabled", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group disabled></fast-radio-group>
                `;
    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 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 have a role of `radiogroup`", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-radio-group></fast-radio-group>
                `;
    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 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

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

            expect(
                await radios.evaluateAll<number, FASTRadio>(
                    radios => radios.filter(radio => radio.checked).length
                )
            ).toBe(1);
    packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 429..433

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

    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

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

            expect(
                await radios.evaluateAll<number, FASTRadio>(
                    radios => radios.filter(radio => radio.checked).length
                )
            ).toBe(1);
    packages/web-components/fast-foundation/src/radio-group/radio-group.pw.spec.ts on lines 405..409

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

    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