Microsoft/fast-dna

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

Summary

Maintainability
F
1 wk
Test Coverage

File number-field.pw.spec.ts has 509 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { spinalCase } from "@microsoft/fast-web-utilities";
import { expect, test } from "@playwright/test";
import type { Locator, Page } from "@playwright/test";
import { fixtureURL } from "../__test__/helpers.js";
import type { FASTNumberField } from "./number-field.js";

    TODO found
    Open

        // TODO: This test doesn't account for the `e` character.

    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 update the proxy value when stepping down", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2" value="5"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 543..561

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

    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 update the proxy value when stepping up", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2" value="5"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 523..541

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

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

        test("should offset an undefined `value` from zero when stepped up", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test.beforeAll(async ({ browser }) => {
            page = await browser.newPage();
    
            element = page.locator("fast-number-field");
    
    
    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/radio-group/radio-group.pw.spec.ts on lines 14..26
    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 7 locations. Consider refactoring.
    Open

        test("should decrement the `value` property by the step amount when the `stepDown()` method is invoked", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2" value="5"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test("should set `value` to match `min` after stepping down when `min` is greater than 0", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field min="10"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456

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

        test("should offset an undefined `value` from zero when stepped down", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test("should increment the `value` property by the step amount when the `stepUp()` method is invoked", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field step="2" value="5"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test("should offset the `value` from zero after stepping down when `min` is a negative value", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field min="-10"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 442..456
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test("should offset the `value` from zero after stepping up when `min` is a negative value", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field min="-10"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 362..376
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 378..392
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 394..408
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 410..424
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 426..440
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 458..472

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

        test("should allow setting `valueAsNumber` property with a number", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 104..120
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 348..360
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 195..207
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 209..221
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 224..236

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

    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 initialize to the provided `value` attribute if set post-connection", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/button/button.pw.spec.ts on lines 114..126
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 181..193

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

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

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

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

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

    Refactorings

    Further Reading

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

        test("should update the `step` attribute on the internal control when the `step` property is changed", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 104..120
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 611..623
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 195..207
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 209..221
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 224..236

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

    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 the `value` property equal to the `min` property when value is less than min", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field min="10"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 266..278
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 280..292
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 294..306

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

    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 allow positive float numbers", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 150..162
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 280..292
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 294..306

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

    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 allow negative float numbers", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 150..162
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 266..278
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 294..306

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

    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 allow positive integer numbers", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 150..162
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 266..278
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 280..292

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

    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

            const [wasIncreased] = await Promise.all([
                element.evaluate(
                    node =>
                        new Promise(resolve => {
                            node.addEventListener("input", () => resolve(true), {
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 251..261

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

    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

            const [wasDecreased] = await Promise.all([
                element.evaluate(
                    node =>
                        new Promise(resolve => {
                            node.addEventListener("input", () => resolve(true), {
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 237..247

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

    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 `max` property equal to the `min` property when min is greater than max", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field min="10" max="5"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/checkbox/checkbox.pw.spec.ts on lines 39..49

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

        test("should initialize to the provided value attribute if set pre-connection", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field value="10"></fast-number-field>
                `;
    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 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 `step` property to "1" by default', async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field></fast-number-field>
                `;
    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/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 4 locations. Consider refactoring.
    Open

        test("should allow reading the `valueAsNumber` property as number", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field value="18"></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/listbox/listbox.pw.spec.ts on lines 94..102
    packages/web-components/fast-foundation/src/progress/progress.pw.spec.ts on lines 85..93
    packages/web-components/fast-foundation/src/slider/slider.pw.spec.ts on lines 40..48

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

        test("should set the `disabled` attribute on the internal control", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field disabled></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 41..49
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 60..67
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 69..76
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 34..42
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 54..62
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 64..72
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 74..82

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

    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 set the `readonly` attribute on the internal control", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field readonly></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 41..49
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 51..58
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 69..76
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 34..42
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 54..62
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 64..72
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 74..82

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

    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 set the `autofocus` attribute on the internal control", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field autofocus></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 51..58
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 60..67
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 69..76
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 34..42
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 54..62
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 64..72
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 74..82

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

    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 set the `required` attribute on the internal control", async () => {
            await root.evaluate(node => {
                node.innerHTML = /* html */ `
                    <fast-number-field required></fast-number-field>
                `;
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 41..49
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 51..58
    packages/web-components/fast-foundation/src/number-field/number-field.pw.spec.ts on lines 60..67
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 34..42
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 44..52
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 54..62
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 64..72
    packages/web-components/fast-foundation/src/text-field/text-field.pw.spec.ts on lines 74..82

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

    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