BookStackApp/BookStack

View on GitHub
resources/js/wysiwyg/lexical/core/LexicalUtils.ts

Summary

Maintainability
F
2 wks
Test Coverage

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 $updateTextNodeFromDOMContent has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    export function $updateTextNodeFromDOMContent(
      textNode: TextNode,
      textContent: string,
      anchorOffset: null | number,
      focusOffset: null | number,
    Severity: Minor
    Found in resources/js/wysiwyg/lexical/core/LexicalUtils.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

    Consider simplifying this complex logical expression.
    Open

          if (
            node.isToken() ||
            (compositionKey !== null &&
              nodeKey === compositionKey &&
              !isComposing) ||
    Severity: Critical
    Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 4 hrs to fix

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

      export function updateDOMBlockCursorElement(
        editor: LexicalEditor,
        rootElement: HTMLElement,
        nextSelection: null | BaseSelection,
      ): void {
      Severity: Minor
      Found in resources/js/wysiwyg/lexical/core/LexicalUtils.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 removeFromParent has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      export function removeFromParent(node: LexicalNode): void {
        const oldParent = node.getParent();
        if (oldParent !== null) {
          const writableNode = node.getWritable();
          const writableParent = oldParent.getWritable();
      Severity: Minor
      Found in resources/js/wysiwyg/lexical/core/LexicalUtils.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 $updateTextNodeFromDOMContent has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function $updateTextNodeFromDOMContent(
        textNode: TextNode,
        textContent: string,
        anchorOffset: null | number,
        focusOffset: null | number,
      Severity: Major
      Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 2 hrs to fix

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

        export function $getAdjacentNode(
          focus: PointType,
          isBackward: boolean,
        ): null | LexicalNode {
          const focusOffset = focus.offset;
        Severity: Minor
        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 2 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 scrollIntoViewIfNeeded has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

        export function scrollIntoViewIfNeeded(
          editor: LexicalEditor,
          selectionRect: DOMRect,
          rootElement: HTMLElement,
        ): void {
        Severity: Minor
        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 2 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 updateDOMBlockCursorElement has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function updateDOMBlockCursorElement(
          editor: LexicalEditor,
          rootElement: HTMLElement,
          nextSelection: null | BaseSelection,
        ): void {
        Severity: Minor
        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 2 hrs to fix

          Function removeFromParent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function removeFromParent(node: LexicalNode): void {
            const oldParent = node.getParent();
            if (oldParent !== null) {
              const writableNode = node.getWritable();
              const writableParent = oldParent.getWritable();
          Severity: Minor
          Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr to fix

            Function scrollIntoViewIfNeeded has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function scrollIntoViewIfNeeded(
              editor: LexicalEditor,
              selectionRect: DOMRect,
              rootElement: HTMLElement,
            ): void {
            Severity: Minor
            Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr to fix

              Function $splitNode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function $splitNode(
                node: ElementNode,
                offset: number,
              ): [ElementNode | null, ElementNode] {
                let startNode = node.getChildAtIndex(offset);
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr to fix

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

                export function $updateSelectedTextFromDOM(
                  isCompositionEnd: boolean,
                  editor: LexicalEditor,
                  data?: string,
                ): void {
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr 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 $setCompositionKey has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                export function $setCompositionKey(compositionKey: null | NodeKey): void {
                  errorOnReadOnly();
                  const editor = getActiveEditor();
                  const previousCompositionKey = editor._compositionKey;
                  if (compositionKey !== previousCompositionKey) {
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr 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 $shouldInsertTextAfterOrBeforeTextNode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                export function $shouldInsertTextAfterOrBeforeTextNode(
                  selection: RangeSelection,
                  node: TextNode,
                ): boolean {
                  if (node.isSegmented()) {
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr 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 $updateSelectedTextFromDOM has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function $updateSelectedTextFromDOM(
                  isCompositionEnd: boolean,
                  editor: LexicalEditor,
                  data?: string,
                ): void {
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (node.isAttached()) {
                                  node.remove();
                                }
                  Severity: Major
                  Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 45 mins to fix

                    Function isMoveToStart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      key: string,
                      ctrlKey: boolean,
                      shiftKey: boolean,
                      altKey: boolean,
                      metaKey: boolean,
                    Severity: Minor
                    Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                      Function $updateTextNodeFromDOMContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        textNode: TextNode,
                        textContent: string,
                        anchorOffset: null | number,
                        focusOffset: null | number,
                        compositionEnd: boolean,
                      Severity: Minor
                      Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                        Function isDeleteForward has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          key: string,
                          ctrlKey: boolean,
                          shiftKey: boolean,
                          altKey: boolean,
                          metaKey: boolean,
                        Severity: Minor
                        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                          Function isMoveToEnd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            key: string,
                            ctrlKey: boolean,
                            shiftKey: boolean,
                            altKey: boolean,
                            metaKey: boolean,
                          Severity: Minor
                          Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                            Function setMutatedNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              mutatedNodes: MutatedNodes,
                              registeredNodes: RegisteredNodes,
                              mutationListeners: MutationListeners,
                              node: LexicalNode,
                              mutation: NodeMutation,
                            Severity: Minor
                            Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                              Function isDeleteBackward has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function isDeleteBackward(
                                key: string,
                                altKey: boolean,
                                metaKey: boolean,
                                ctrlKey: boolean,
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins 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 $nodesOfType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function $nodesOfType<T extends LexicalNode>(klass: Klass<T>): Array<T> {
                                const klassType = klass.getType();
                                const editorState = getActiveEditorState();
                                if (editorState._readOnly) {
                                  const nodes = getCachedTypeToNodeMap(editorState).get(klassType) as
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins 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 $splitNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function $splitNode(
                                node: ElementNode,
                                offset: number,
                              ): [ElementNode | null, ElementNode] {
                                let startNode = node.getChildAtIndex(offset);
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins 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 setMutatedNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function setMutatedNode(
                                mutatedNodes: MutatedNodes,
                                registeredNodes: RegisteredNodes,
                                mutationListeners: MutationListeners,
                                node: LexicalNode,
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins 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 getCachedTypeToNodeMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function getCachedTypeToNodeMap(
                                editorState: EditorState,
                              ): TypeToNodeMap {
                                // If this is a new Editor it may have a writable this._editorState
                                // with only a 'root' entry.
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins 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

                              Avoid too many return statements within this function.
                              Open

                                  return false;
                              Severity: Major
                              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 30 mins to fix

                                Function INTERNAL_$isBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function INTERNAL_$isBlock(
                                  node: LexicalNode,
                                ): node is ElementNode | DecoratorNode<unknown> {
                                  if ($isRootNode(node) || ($isDecoratorNode(node) && !node.isInline())) {
                                    return true;
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 25 mins 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 $setSelection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function $setSelection(selection: null | BaseSelection): void {
                                  errorOnReadOnly();
                                  const editorState = getActiveEditorState();
                                  if (selection !== null) {
                                    if (__DEV__) {
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 25 mins 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 isDeleteForward has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function isDeleteForward(
                                  key: string,
                                  ctrlKey: boolean,
                                  shiftKey: boolean,
                                  altKey: boolean,
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 25 mins 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 errorOnNodeKeyConstructorMismatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function errorOnNodeKeyConstructorMismatch(
                                  node: LexicalNode,
                                  existingKey: NodeKey,
                                ) {
                                  const editorState = internalGetActiveEditorState();
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 25 mins 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

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

                                export function removeFromParent(node: LexicalNode): void {
                                  const oldParent = node.getParent();
                                  if (oldParent !== null) {
                                    const writableNode = node.getWritable();
                                    const writableParent = oldParent.getWritable();
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 2 days to fix
                                resources/js/wysiwyg/lexical/yjs/Utils.ts on lines 477..526

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

                                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

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

                                export function $getAncestor<NodeType extends LexicalNode = LexicalNode>(
                                  node: LexicalNode,
                                  predicate: (ancestor: LexicalNode) => ancestor is NodeType,
                                ) {
                                  let parent = node;
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 4 hrs to fix
                                resources/js/wysiwyg/lexical/selection/range-selection.ts on lines 599..608

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

                                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

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

                                export function $findMatchingParent(
                                  startingNode: LexicalNode,
                                  findFn: (node: LexicalNode) => boolean,
                                ): LexicalNode | null {
                                  let curr: ElementNode | LexicalNode | null = startingNode;
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 2 hrs to fix
                                resources/js/wysiwyg/lexical/utils/index.ts on lines 333..348

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

                                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

                                export function isCopy(
                                  key: string,
                                  shiftKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 2 hrs to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 937..951

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

                                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

                                export function isCut(
                                  key: string,
                                  shiftKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 2 hrs to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 921..935

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

                                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

                                export function isMoveToEnd(
                                  key: string,
                                  ctrlKey: boolean,
                                  shiftKey: boolean,
                                  altKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 978..986

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

                                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

                                export function isMoveToStart(
                                  key: string,
                                  ctrlKey: boolean,
                                  shiftKey: boolean,
                                  altKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 997..1005

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

                                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 4 locations. Consider refactoring.
                                Open

                                export function isUnderline(
                                  key: string,
                                  altKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 3 other locations - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 786..795
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 797..806
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 895..904

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

                                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 4 locations. Consider refactoring.
                                Open

                                export function isBold(
                                  key: string,
                                  altKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 3 other locations - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 797..806
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 808..817
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 895..904

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

                                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 4 locations. Consider refactoring.
                                Open

                                export function isItalic(
                                  key: string,
                                  altKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 3 other locations - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 786..795
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 808..817
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 895..904

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

                                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 4 locations. Consider refactoring.
                                Open

                                export function isUndo(
                                  key: string,
                                  shiftKey: boolean,
                                  metaKey: boolean,
                                  ctrlKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 3 other locations - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 786..795
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 797..806
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 808..817

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

                                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

                                export function isMoveBackward(
                                  key: string,
                                  ctrlKey: boolean,
                                  altKey: boolean,
                                  metaKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 988..995

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

                                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

                                export function isMoveForward(
                                  key: string,
                                  ctrlKey: boolean,
                                  altKey: boolean,
                                  metaKey: boolean,
                                Severity: Major
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 1 hr to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 969..976

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

                                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

                                export function isBlockDomNode(node: Node) {
                                  const blockNodes = new RegExp(
                                    /^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,
                                    'i',
                                  );
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 55 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 1653..1659

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

                                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

                                export function isInlineDomNode(node: Node) {
                                  const inlineNodes = new RegExp(
                                    /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,
                                    'i',
                                  );
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 55 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 1666..1672

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

                                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

                                export function isMoveUp(
                                  key: string,
                                  ctrlKey: boolean,
                                  metaKey: boolean,
                                ): boolean {
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 40 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 1015..1021

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

                                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

                                export function isMoveDown(
                                  key: string,
                                  ctrlKey: boolean,
                                  metaKey: boolean,
                                ): boolean {
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 40 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 1007..1013

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

                                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

                                export function isDeleteWordForward(
                                  key: string,
                                  altKey: boolean,
                                  ctrlKey: boolean,
                                ): boolean {
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 35 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 834..840

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

                                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

                                export function isDeleteWordBackward(
                                  key: string,
                                  altKey: boolean,
                                  ctrlKey: boolean,
                                ): boolean {
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 35 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 842..848

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

                                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

                                export function getElementByKeyOrThrow(
                                  editor: LexicalEditor,
                                  key: NodeKey,
                                ): HTMLElement {
                                  const element = editor._keyToDOMMap.get(key);
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 35 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 87..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 46.

                                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

                                export function getRegisteredNodeOrThrow(
                                  editor: LexicalEditor,
                                  nodeType: string,
                                ): RegisteredNode {
                                  const registeredNode = editor._nodes.get(nodeType);
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts and 1 other location - About 35 mins to fix
                                resources/js/wysiwyg/lexical/core/LexicalUtils.ts on lines 1228..1243

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

                                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

                                There are no issues that match your filters.

                                Category
                                Status