Microsoft/fast-dna

View on GitHub

Showing 426 of 3,220 total issues

Function FormAssociated has 226 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function FormAssociated<T extends ConstructableFormAssociated>(BaseCtor: T): T {
    const C = class extends BaseCtor {
        /**
         * The proxy element - this element serves as the communication layer with the parent form
         * when form association is not supported by the browser.

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

    import { expect } from "chai";
    import { html, ViewTemplate } from "./template.js";
    import { Markup, nextId, Parser } from "./markup.js";
    import { HTMLBindingDirective } from "./html-binding-directive.js";
    import { HTMLDirective, ViewBehaviorFactory, Aspected, htmlDirective, AddViewBehaviorFactory, CompiledViewBehaviorFactory } from "./html-directive.js";
    Severity: Major
    Found in packages/web-components/fast-element/src/templating/template.spec.ts - About 1 day to fix

      File element-controller.spec.ts has 537 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import chai, { expect } from "chai";
      import { ElementStyles } from "../index.debug.js";
      import type { HostBehavior, HostController } from "../styles/host.js";
      import { observable, Observable } from "../observation/observable.js";
      import { css } from "../styles/css.js";

        Function renderOpCodes has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
        Open

            public *renderOpCodes(
                codes: Op[],
                renderInfo: RenderInfo,
                source: unknown,
                context: ExecutionContext

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        import type { Disposable, ExpressionNotifier, Subscriber } from "@microsoft/fast-element";
        import { Observable } from "@microsoft/fast-element";
        import type { DesignToken } from "./design-token.js";
        
        /**

          Function Observable has 209 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const Observable = FAST.getById(KernelServiceId.observable, () => {
              const queueUpdate = Updates.enqueue;
              const volatileRegex = /(:|&&|\|\||if|\?\.)/;
              const notifierLookup = new WeakMap<any, Notifier>();
              let watcher: ExpressionNotifierImplementation | undefined = void 0;
          Severity: Major
          Found in packages/web-components/fast-element/src/observation/observable.ts - About 1 day to fix

            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";

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

              import type { Locator, Page } from "@playwright/test";
              import { expect, test } from "@playwright/test";
              import { fixtureURL } from "../__test__/helpers.js";
              import type { FASTCalendar } from "./calendar.js";
              import { DateFormatter } from "./date-formatter.js";

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

                import { expect, test } from "@playwright/test";
                import type { Locator, Page } from "@playwright/test";
                import { fixtureURL } from "../__test__/helpers.js";
                import type { FASTCombobox } from "./combobox.js";
                
                

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

                  import { expect } from "chai";
                  import { Updates } from "./update-queue.js";
                  import { PropertyChangeNotifier, SubscriberSet } from "./notifier.js";
                  import { ExecutionContext, Expression, Observable, observable, volatile } from "./observable.js";
                  import { Fake } from "../testing/fakes.js";

                    Function parseStringToOpCodes has 182 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function parseStringToOpCodes(
                        /**
                         * The string to parse
                         */
                        templateString: string,

                      Function Observable has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const Observable = FAST.getById(KernelServiceId.observable, () => {
                          const queueUpdate = Updates.enqueue;
                          const volatileRegex = /(:|&&|\|\||if|\?\.)/;
                          const notifierLookup = new WeakMap<any, Notifier>();
                          let watcher: ExpressionNotifierImplementation | undefined = void 0;
                      Severity: Minor
                      Found in packages/web-components/fast-element/src/observation/observable.ts - About 7 hrs to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                      import { expect } from "chai";
                      import {
                          AdoptedStyleSheetsStrategy, StyleElementStrategy
                      } from "../components/element-controller.js";
                      import type { StyleTarget } from "./style-strategy.js";
                      Severity: Minor
                      Found in packages/web-components/fast-element/src/styles/styles.spec.ts - About 7 hrs to fix

                        FASTAnchoredRegion has 49 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        export class FASTAnchoredRegion extends FASTElement {
                            /**
                             * The HTML ID of the anchor element this region is positioned relative to
                             *
                             * @public

                          File update-queue.spec.ts has 425 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { expect } from "chai";
                          import { Updates } from "./update-queue.js";
                          
                          const waitMilliseconds = 100;
                          const maxRecursion = 10;

                            File element-controller.ts has 422 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { Message, Mutable } from "../interfaces.js";
                            import { PropertyChangeNotifier } from "../observation/notifier.js";
                            import {
                                ExecutionContext,
                                ExpressionController,

                              Function getDependencies has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getDependencies(Type: Constructable | Injectable): Key[] {
                                      // Note: Every detail of this getDependencies method is pretty deliberate at the moment,
                                      // and probably not yet 100% tested from every possible angle,
                                      // so be careful with making changes here as it can have a huge impact on complex end user apps.
                                      // Preferably, only make changes to the dependency resolution process via a RFC.
                              Severity: Minor
                              Found in packages/web-components/fast-element/src/di/di.ts - About 5 hrs to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

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

                              import type { Locator, Page } from "@playwright/test";
                              import { expect, test } from "@playwright/test";
                              import { fixtureURL } from "../__test__/helpers.js";
                              import { ToolbarOrientation } from "./toolbar.options.js";
                              
                              

                                File render.ts has 409 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { FASTElementDefinition } from "../components/fast-definitions.js";
                                import type { FASTElement } from "../components/fast-element.js";
                                import type { DOMPolicy } from "../dom.js";
                                import { Constructable, isFunction, isString } from "../interfaces.js";
                                import { Binding, BindingDirective } from "../binding/binding.js";
                                Severity: Minor
                                Found in packages/web-components/fast-element/src/templating/render.ts - About 5 hrs to fix

                                  File combobox.ts has 406 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { autoUpdate, computePosition, flip, hide, size } from "@floating-ui/dom";
                                  import { attr, Observable, observable, Updates } from "@microsoft/fast-element";
                                  import { limit, uniqueId } from "@microsoft/fast-web-utilities";
                                  import type { StaticallyComposableHTML } from "../utilities/template-helpers.js";
                                  import type { FASTListboxOption } from "../listbox-option/listbox-option.js";
                                  Severity: Minor
                                  Found in packages/web-components/fast-foundation/src/combobox/combobox.ts - About 5 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language