Microsoft/fast-dna

View on GitHub

Showing 426 of 3,220 total issues

FASTCombobox has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

export class FASTCombobox extends FormAssociatedCombobox {
    /**
     * The internal value property.
     *
     * @internal
Severity: Minor
Found in packages/web-components/fast-foundation/src/combobox/combobox.ts - About 4 hrs to fix

    File menu.register.ts has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { html } from "@microsoft/fast-element";
    import { attr } from "@microsoft/fast-element";
    import { css } from "@microsoft/fast-element";
    import { FASTMenuItem, MenuItemRole, menuItemTemplate } from "../../menu-item/index.js";
    import { FASTMenu } from "../menu.js";

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

      import {
          Disposable,
          isFunction,
          isString,
          KernelServiceId,
      Severity: Minor
      Found in packages/web-components/fast-element/src/observation/observable.ts - About 3 hrs to fix

        File menu.pw.spec.ts has 324 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 { FASTMenu } from "./menu.js";
        
        
        Severity: Minor
        Found in packages/web-components/fast-foundation/src/menu/menu.pw.spec.ts - About 3 hrs to fix

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

          import "../install-dom-shim.js";
          import { children, css, customElement, ExecutionContext, FASTElement, html, ref, repeat, slotted, when } from "@microsoft/fast-element";
          import { expect, test } from "@playwright/test";
          import fastSSR from "../exports.js";
          import { consolidate } from "../test-utilities/consolidate.js";

            Function handleKeydown has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public handleKeydown(e: KeyboardEvent): void {
                    // if the cell does not have an internal focus queue we can ignore keystrokes
                    if (
                        e.defaultPrevented ||
                        this.columnDefinition === null ||

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

            import { autoUpdate, computePosition, flip, hide, size } from "@floating-ui/dom";
            import { attr, Observable, observable, Updates, volatile } from "@microsoft/fast-element";
            import {
                keyArrowDown,
                keyArrowUp,
            Severity: Minor
            Found in packages/web-components/fast-foundation/src/select/select.ts - About 3 hrs to fix

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

              import { attr, FASTElement, observable } from "@microsoft/fast-element";
              import {
                  ArrowKeys,
                  Direction,
                  keyArrowDown,

                Function handleKeyDown has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public handleKeyDown(e: KeyboardEvent): boolean {
                        if (e.defaultPrevented || this.disabled) {
                            return false;
                        }
                        const activeElement = getRootActiveElement(this);
                Severity: Major
                Found in packages/web-components/fast-foundation/src/picker/picker.ts - About 3 hrs to fix

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

                  import type { Locator, Page } from "@playwright/test";
                  import { expect, test } from "@playwright/test";
                  import type { FASTTab } from "../tab/tab.js";
                  import { fixtureURL } from "../__test__/helpers.js";
                  import type { FASTTabs } from "./tabs.js";
                  Severity: Minor
                  Found in packages/web-components/fast-foundation/src/tabs/tabs.pw.spec.ts - About 3 hrs to fix

                    Function handleMultiRowPointerSelection has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private handleMultiRowPointerSelection(
                            changedRow: FASTDataGridRow,
                            changeEventDetail: DataGridSelectionChangeDetail
                        ): void {
                            let newSelection: number[] = this.selectedRowIndexes.slice();
                    Severity: Minor
                    Found in packages/web-components/fast-foundation/src/data-grid/data-grid.ts - About 3 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

                    Function DesignToken has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const DesignToken: Story = () => {
                        const controllerElementName = "fast-design-token-controller";
                        const fixtureElementName = "fast-design-token-fixture";
                    
                        // Define element that can have token mutated for it

                      File listbox.ts has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { attr, FASTElement, observable, Observable } from "@microsoft/fast-element";
                      import {
                          findLastIndex,
                          keyArrowDown,
                          keyArrowUp,
                      Severity: Minor
                      Found in packages/web-components/fast-foundation/src/listbox/listbox.ts - About 3 hrs to fix

                        Function parseElementNode has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function parseElementNode(node: DefaultTreeElement): void {
                                // Track whether the opening tag of an element should be augmented.
                                // All constructable custom elements will need to be augmented,
                                // as well as any element with attribute bindings
                                let augmentOpeningTag = false;

                          Function calc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function calc(
                              current: unknown[],
                              currentStart: number,
                              currentEnd: number,
                              old: unknown[],
                          Severity: Minor
                          Found in packages/web-components/fast-element/src/observation/arrays.ts - About 3 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

                          Function updateContent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function updateContent(
                              target: ContentTarget,
                              aspect: string,
                              value: any,
                              controller: ViewController

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

                          import { attr, nullableNumberConverter, observable } from "@microsoft/fast-element";
                          import {
                              Direction,
                              keyArrowDown,
                              keyArrowLeft,
                          Severity: Minor
                          Found in packages/web-components/fast-foundation/src/slider/slider.ts - About 3 hrs to fix

                            File switch.pw.spec.ts has 307 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 { FASTSwitch } from "./switch.js";
                            
                            
                            Severity: Minor
                            Found in packages/web-components/fast-foundation/src/switch/switch.pw.spec.ts - About 3 hrs to fix

                              FASTListbox has 28 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              export abstract class FASTListbox extends FASTElement {
                                  /**
                                   * The internal unfiltered list of selectable options.
                                   *
                                   * @internal
                              Severity: Minor
                              Found in packages/web-components/fast-foundation/src/listbox/listbox.ts - About 3 hrs to fix

                                Function merge has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function merge(splice: Splice, splices: Splice[]): void {
                                    let inserted = false;
                                    let insertionOffset = 0;
                                
                                    for (let i = 0; i < splices.length; i++) {
                                Severity: Minor
                                Found in packages/web-components/fast-element/src/observation/arrays.ts - About 3 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

                                Severity
                                Category
                                Status
                                Source
                                Language