BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

File LexicalSelectionHelpers.test.ts has 2520 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.

    File LexicalSelection.ts has 2308 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright (c) Meta Platforms, Inc. and affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
    Severity: Major
    Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 6 days to fix

      File LexicalTableSelectionHelpers.ts has 1595 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Copyright (c) Meta Platforms, Inc. and affiliates.
       *
       * This source code is licensed under the MIT license found in the
       * LICENSE file in the root directory of this source tree.
      Severity: Major
      Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 4 days to fix

        File LexicalUtils.ts has 1523 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Copyright (c) Meta Platforms, Inc. and affiliates.
         *
         * This source code is licensed under the MIT license found in the
         * LICENSE file in the root directory of this source tree.
        Severity: Major
        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 4 days to fix

          Function applyTableHandlers has 709 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function applyTableHandlers(
            tableNode: TableNode,
            tableElement: HTMLTableElementWithWithTableSelectionState,
            editor: LexicalEditor,
            hasTabHandler: boolean,
          Severity: Major
          Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 3 days to fix

            File LexicalNode.test.ts has 1268 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Copyright (c) Meta Platforms, Inc. and affiliates.
             *
             * This source code is licensed under the MIT license found in the
             * LICENSE file in the root directory of this source tree.
            Severity: Major
            Found in resources/js/wysiwyg/lexical/core/__tests__/unit/LexicalNode.test.ts - About 3 days to fix

              Function insertText has a Cognitive Complexity of 149 (exceeds 5 allowed). Consider refactoring.
              Open

                insertText(text: string): void {
                  const anchor = this.anchor;
                  const focus = this.focus;
                  const format = this.format;
                  const style = this.style;
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 3 days 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 LexicalListItemNode.test.ts has 1174 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Copyright (c) Meta Platforms, Inc. and affiliates.
               *
               * This source code is licensed under the MIT license found in the
               * LICENSE file in the root directory of this source tree.

                Function $handleArrowKey has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
                Open

                function $handleArrowKey(
                  editor: LexicalEditor,
                  event: KeyboardEvent,
                  direction: Direction,
                  tableNode: TableNode,
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 2 days 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 LexicalEvents.ts has 1106 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * Copyright (c) Meta Platforms, Inc. and affiliates.
                 *
                 * This source code is licensed under the MIT license found in the
                 * LICENSE file in the root directory of this source tree.
                Severity: Major
                Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 2 days to fix

                  File LexicalTextNode.ts has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * Copyright (c) Meta Platforms, Inc. and affiliates.
                   *
                   * This source code is licensed under the MIT license found in the
                   * LICENSE file in the root directory of this source tree.
                  Severity: Major
                  Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts - About 2 days to fix

                    Function registerRichText has 490 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function registerRichText(editor: LexicalEditor): () => void {
                      const removeListener = mergeRegister(
                        editor.registerCommand(
                          CLICK_COMMAND,
                          (payload) => {
                    Severity: Major
                    Found in resources/js/wysiwyg/lexical/rich-text/index.ts - About 2 days to fix

                      File index.ts has 954 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /**
                       * Copyright (c) Meta Platforms, Inc. and affiliates.
                       *
                       * This source code is licensed under the MIT license found in the
                       * LICENSE file in the root directory of this source tree.
                      Severity: Major
                      Found in resources/js/wysiwyg/lexical/rich-text/index.ts - About 2 days to fix

                        File LexicalEditor.ts has 867 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Copyright (c) Meta Platforms, Inc. and affiliates.
                         *
                         * This source code is licensed under the MIT license found in the
                         * LICENSE file in the root directory of this source tree.
                        Severity: Major
                        Found in resources/js/wysiwyg/lexical/core/LexicalEditor.ts - About 2 days to fix

                          File LexicalUpdates.ts has 848 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * Copyright (c) Meta Platforms, Inc. and affiliates.
                           *
                           * This source code is licensed under the MIT license found in the
                           * LICENSE file in the root directory of this source tree.
                          Severity: Major
                          Found in resources/js/wysiwyg/lexical/core/LexicalUpdates.ts - About 2 days to fix

                            File LexicalTableUtils.ts has 790 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /**
                             * Copyright (c) Meta Platforms, Inc. and affiliates.
                             *
                             * This source code is licensed under the MIT license found in the
                             * LICENSE file in the root directory of this source tree.
                            Severity: Major
                            Found in resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts - About 1 day to fix

                              Function modify has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                              Open

                                Selection.prototype.modify = function (alter, direction, granularity) {
                                  // This is not a thorough implementation, it was more to get tests working
                                  // given the refactor to use this selection method.
                                  const symbol = Object.getOwnPropertySymbols(this)[0];
                                  // eslint-disable-next-line @typescript-eslint/no-explicit-any
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/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 index.ts has 780 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * Copyright (c) Meta Platforms, Inc. and affiliates.
                               *
                               * This source code is licensed under the MIT license found in the
                               * LICENSE file in the root directory of this source tree.
                              Severity: Major
                              Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts - About 1 day to fix

                                File LexicalTextNode.test.ts has 771 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /**
                                 * Copyright (c) Meta Platforms, Inc. and affiliates.
                                 *
                                 * This source code is licensed under the MIT license found in the
                                 * LICENSE file in the root directory of this source tree.

                                  File LexicalReconciler.ts has 678 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /**
                                   * Copyright (c) Meta Platforms, Inc. and affiliates.
                                   *
                                   * This source code is licensed under the MIT license found in the
                                   * LICENSE file in the root directory of this source tree.
                                  Severity: Major
                                  Found in resources/js/wysiwyg/lexical/core/LexicalReconciler.ts - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language