Microsoft/fast-dna

View on GitHub

Showing 3,456 of 3,457 total issues

File recognizer.spec.ts has 2171 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
    ConfigurableRoute,
    DefaultRouteRecognizer,
    Endpoint,
    RecognizedRoute,
Severity: Major
Found in packages/web-components/fast-router/src/recognizer.spec.ts - About 6 days to fix

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

        context("when binding one-time", () => {
            for (const aspectScenario of aspectScenarios) {
                it(`sets the initial value of a ${aspectScenario.name} binding`, () => {
                    const { behavior, node, targets } = oneTimeBinding(aspectScenario.sourceAspect);
                    const model = new Model(aspectScenario.originalValue);
    packages/web-components/fast-element/src/templating/binding.spec.ts on lines 422..491

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

    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

        context("when binding on-change", () => {
            for (const aspectScenario of aspectScenarios) {
                it(`sets the initial value of a ${aspectScenario.name} binding`, () => {
                    const { behavior, node, targets } = defaultBinding(aspectScenario.sourceAspect);
                    const model = new Model(aspectScenario.originalValue);
    packages/web-components/fast-element/src/templating/binding.spec.ts on lines 493..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 830.

    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

    File fast-design-token.pw.spec.ts has 1329 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable @typescript-eslint/no-empty-function */
    import type {
        css as FASTcss,
        FASTElement,
        Observable as FASTObservable,

      File di.ts has 1185 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project
       * for the bulk of this code and many of the associated tests.
       */
      import { Context, ContextDecorator, ContextEvent, UnknownContext } from "../context.js";
      Severity: Major
      Found in packages/web-components/fast-element/src/di/di.ts - About 3 days to fix

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

            test("should generate a basic grid with a row header based on rowsData only", async () => {
                await root.evaluate(node => {
                    node.innerHTML = /* html */ `
                        <fast-data-grid></fast-data-grid>
                    `;
        packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 191..244

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

        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 generate a sticky header when generateHeader is set to 'sticky'", async () => {
                await root.evaluate(node => {
                    node.innerHTML = /* html */ `
                        <fast-data-grid generate-header="sticky"></fast-data-grid>
                    `;
        packages/web-components/fast-foundation/src/data-grid/data-grid.pw.spec.ts on lines 77..130

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

        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

        File design-token-node.pw.spec.ts has 1033 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import "./test/fast-element-dom-shim.js";
        import type { Subscriber } from "@microsoft/fast-element";
        import { Observable } from "@microsoft/fast-element";
        import { reactive } from "@microsoft/fast-element/state.js";
        import { test } from "@playwright/test";

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

              it("observes pushes", async () => {
                  ArrayObserver.enable();
                  const array: string[] = [];
          
                  array.push("foo");
          packages/web-components/fast-element/src/observation/arrays.spec.ts on lines 299..337

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

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

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

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

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

          Refactorings

          Further Reading

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

              it("observes unshifts", async () => {
                  ArrayObserver.enable();
                  let array: string[] = [];
          
                  array.unshift("foo");
          packages/web-components/fast-element/src/observation/arrays.spec.ts on lines 98..136

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

          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("parseColorHexARGB", () => {
                  function testColor(data: any): void {
                      let rgba: ColorRGBA64 | null = parseColor(data.hexARGBString);
          
                      expect(rgba).not.to.be.undefined;
          Severity: Major
          Found in packages/utilities/fast-colors/src/parse-color.spec.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 192..212
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 214..234

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

          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("parseColorNamed", () => {
                  function testColor(data: any): void {
                      let rgba: ColorRGBA64 | null = parseColor(data.name);
          
                      expect(rgba).not.to.be.undefined;
          Severity: Major
          Found in packages/utilities/fast-colors/src/parse-color.spec.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 84..105
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 192..212

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

          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("parseColorWebLong", () => {
                  function testColor(data: any): void {
                      let rgba: ColorRGBA64 | null = parseColor(data.webRGBAString);
          
                      expect(rgba).not.to.be.undefined;
          Severity: Major
          Found in packages/utilities/fast-colors/src/parse-color.spec.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 84..105
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 214..234

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

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

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

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

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

          Refactorings

          Further Reading

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

              it("observes shifts", async () => {
                  ArrayObserver.enable();
                  const array = ["foo", "bar", "hello", "world"];
          
                  array.shift();
          packages/web-components/fast-element/src/observation/arrays.spec.ts on lines 58..96

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

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

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

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

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

          Refactorings

          Further Reading

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

              it("observes pops", async () => {
                  ArrayObserver.enable();
                  const array = ["foo", "bar", "hello", "world"];
          
                  array.pop();
          packages/web-components/fast-element/src/observation/arrays.spec.ts on lines 177..215

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

          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("parseColorWebShort", () => {
                  function testColor(data: any): void {
                      let rgb: ColorRGBA64 | null = parseColor(data.webRGBString);
          
                      expect(rgb).not.to.be.undefined;
          Severity: Major
          Found in packages/utilities/fast-colors/src/parse-color.spec.ts and 1 other location - About 2 days to fix
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 42..62

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

          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("parseColorHexRGB", () => {
                  function testColor(data: any): void {
                      let rgb: ColorRGBA64 | null = parseColor(data.hexRGBString);
          
                      expect(rgb).not.to.be.undefined;
          Severity: Major
          Found in packages/utilities/fast-colors/src/parse-color.spec.ts and 1 other location - About 2 days to fix
          packages/utilities/fast-colors/src/parse-color.spec.ts on lines 170..190

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

          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

          export class ColorLCH {
              /**
               * Construct a {@link ColorLCH} from a config object.
               * @param data - the config object
               */
          Severity: Major
          Found in packages/utilities/fast-colors/src/color-lch.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/color-hsl.ts on lines 8..55
          packages/utilities/fast-colors/src/color-hsv.ts on lines 8..55

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

          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

          export class ColorHSL {
              /**
               * Construct a {@link ColorHSL} from a config object.
               */
              public static fromObject(data: { h: number; s: number; l: number }): ColorHSL | null {
          Severity: Major
          Found in packages/utilities/fast-colors/src/color-hsl.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/color-hsv.ts on lines 8..55
          packages/utilities/fast-colors/src/color-lch.ts on lines 14..62

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

          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

          export class ColorHSV {
              /**
               * Construct a {@link ColorHSV} from a config object.
               */
              public static fromObject(data: { h: number; s: number; v: number }): ColorHSV | null {
          Severity: Major
          Found in packages/utilities/fast-colors/src/color-hsv.ts and 2 other locations - About 2 days to fix
          packages/utilities/fast-colors/src/color-hsl.ts on lines 8..55
          packages/utilities/fast-colors/src/color-lch.ts on lines 14..62

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

          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

          Severity
          Category
          Status
          Source
          Language