Microsoft/fast-dna

View on GitHub

Showing 495 of 3,424 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

    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

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

          File named-colors.ts has 893 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { ColorRGBA64Config } from "./color-rgba-64.js";
          
          /**
           * Browser {@link https://www.w3schools.com/colors/colors_names.asp | named colors}.
           * @public
          Severity: Major
          Found in packages/utilities/fast-colors/src/named-colors.ts - About 2 days to fix

            File anchored-region.ts has 878 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { attr, FASTElement, observable, Updates } from "@microsoft/fast-element";
            import { Direction, eventResize, eventScroll } from "@microsoft/fast-web-utilities";
            import { getDirection } from "../utilities/direction.js";
            import { IntersectionService } from "../utilities/intersection-service.js";
            import type {

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

              import {
                  Container,
                  ContainerImpl,
                  DI,
                  FactoryImpl,
              Severity: Major
              Found in packages/web-components/fast-element/src/di/di.spec.ts - About 1 day to fix

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

                import { observable } from "../observation/observable.js";
                import { RepeatBehavior, RepeatDirective, repeat } from "./repeat.js";
                import { expect } from "chai";
                import { html } from "./template.js";
                import { toHTML } from "../__test__/helpers.js";
                Severity: Major
                Found in packages/web-components/fast-element/src/templating/repeat.spec.ts - About 1 day to fix

                  File data-grid.ts has 697 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import type { SyntheticViewTemplate, ViewTemplate } from "@microsoft/fast-element";
                  import {
                      attr,
                      FASTElement,
                      nullableNumberConverter,
                  Severity: Major
                  Found in packages/web-components/fast-foundation/src/data-grid/data-grid.ts - About 1 day to fix

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

                    import { Route } from "./navigation.js";
                    import { QueryString } from "./query-string.js";
                    
                    /**
                     * @beta
                    Severity: Major
                    Found in packages/web-components/fast-router/src/recognizer.ts - About 1 day to fix

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

                      import { expect } from "chai";
                      import { HTMLBindingDirective } from "./html-binding-directive.js";
                      import { observable } from "../observation/observable.js";
                      import { html, ViewTemplate } from "./template.js";
                      import { createTrackableDOMPolicy, toHTML } from "../__test__/helpers.js";
                      Severity: Major
                      Found in packages/web-components/fast-element/src/templating/binding.spec.ts - About 1 day to fix

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

                        import { expect } from "chai";
                        import { customElement, FASTElement } from "../components/fast-element.js";
                        import { observable } from "../observation/observable.js";
                        import { Updates } from "../observation/update-queue.js";
                        import { Fake } from "../testing/fakes.js";
                        Severity: Major
                        Found in packages/web-components/fast-element/src/templating/render.spec.ts - About 1 day to fix

                          Function parseStringToOpCodes has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
                          Open

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

                          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 picker.ts has 623 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import {
                              attr,
                              html,
                              HTMLView,
                              nullableNumberConverter,
                          Severity: Major
                          Found in packages/web-components/fast-foundation/src/picker/picker.ts - About 1 day to fix

                            Function FormAssociated has a Cognitive Complexity of 68 (exceeds 5 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.

                            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 arrays.ts has 611 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { emptyArray } from "../platform.js";
                            import { Notifier, Subscriber, SubscriberSet } from "./notifier.js";
                            import { Observable } from "./observable.js";
                            import { Updates } from "./update-queue.js";
                            
                            
                            Severity: Major
                            Found in packages/web-components/fast-element/src/observation/arrays.ts - About 1 day to fix

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

                              import { DI, Container, inject, Registration, singleton } from "./di.js";
                              import chai, { expect } from "chai";
                              import spies from "chai-spies";
                              import type { ContextDecorator } from "../context.js";
                              
                              
                              Severity: Major
                              Found in packages/web-components/fast-element/src/di/di.integration.spec.ts - About 1 day to fix

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

                                import { expect } from "chai";
                                import {
                                    all,
                                    DI,
                                    Container,
                                Severity: Major
                                Found in packages/web-components/fast-element/src/di/di.get.spec.ts - About 1 day to fix

                                  Function reactWrapper has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function reactWrapper(
                                      React: any,
                                      registry: CustomElementRegistry = customElements
                                  ) {
                                      /**
                                  Severity: Minor
                                  Found in packages/utilities/fast-react-wrapper/src/index.ts - About 1 day 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 compiler.spec.ts has 586 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { expect } from "chai";
                                  import { customElement, FASTElement } from "../components/fast-element.js";
                                  import { Markup } from './markup.js';
                                  import { css } from "../styles/css.js";
                                  import { createTrackableDOMPolicy, toHTML } from "../__test__/helpers.js";
                                  Severity: Major
                                  Found in packages/web-components/fast-element/src/templating/compiler.spec.ts - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language