BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Consider simplifying this complex logical expression.
Open

    if (
        nodeName === 'h1' ||
        nodeName === 'h2' ||
        nodeName === 'h3' ||
        nodeName === 'h4' ||
Severity: Major
Found in resources/js/wysiwyg/nodes/custom-heading.ts - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if (
                  offset === 0 &&
                  delCount === 1 &&
                  nodeIndex > 0 &&
                  prevCollabNode instanceof CollabTextNode &&
    Severity: Major
    Found in resources/js/wysiwyg/lexical/yjs/CollabElementNode.ts - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (
                (_$isTextNode && anchorOffset === anchorNode.textContent.length) ||
                (!_$isTextNode &&
                  (anchorNode.childNodes.length === anchorOffset ||
                    (anchorNode.childNodes.length === 1 &&
      Severity: Major
      Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if (
              // We might have removed a node that no longer exists
              !anchorNode.isAttached() ||
              !focusNode.isAttached() ||
              // If we've split a node, then the offset might not be right
        Severity: Major
        Found in resources/js/wysiwyg/lexical/yjs/Utils.ts - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

              } else if ($isRangeSelection(selection)) {
                const tableCellNode = $findMatchingParent(
                  selection.anchor.getNode(),
                  (n) => $isTableCellNode(n),
                );
          Severity: Major
          Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  nextAnchorNode &&
                  prevAnchorNode &&
                  !prevEditorState._nodeMap.has(nextAnchorNode.__key) &&
                  $isTextNode(nextAnchorNode) &&
            Severity: Major
            Found in resources/js/wysiwyg/lexical/history/index.ts - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if (
                        selection &&
                        !selection.is(prevSelection) &&
                        ($isTableSelection(selection) || $isTableSelection(prevSelection)) &&
                        tableObserver.tableSelection &&
              Severity: Major
              Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                  if (
                    isCollapsed &&
                    (prevSelection === null ||
                      anchorFormatOrStyleChanged ||
                      ($isRangeSelection(prevSelection) &&
                Severity: Major
                Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if (
                          // If it has been 30ms since the last keydown, then we should
                          // apply the empty space heuristic. We can't do this for Safari,
                          // as the keydown fires after composition start.
                          event.timeStamp < lastKeyDownTimeStamp + ANDROID_COMPOSITION_LATENCY ||
                  Severity: Major
                  Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                      if (
                        !tags.has('skip-scroll-into-view') &&
                        nextSelection.isCollapsed() &&
                        rootElement !== null &&
                        rootElement === document.activeElement
                    Severity: Major
                    Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                isPossiblyAndroidKeyPress(event.timeStamp) &&
                                editor.isComposing() &&
                                isSelectionAnchorSameAsFocus
                              ) {
                      Severity: Major
                      Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if (
                            anchorOffset === nextAnchorOffset &&
                            focusOffset === nextFocusOffset &&
                            anchorDOMNode === nextAnchorNode &&
                            focusDOMNode === nextFocusNode && // Badly interpreted range selection when collapsed - #1482
                        Severity: Major
                        Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                              } else if (
                                (isCollapsed || isBackward) &&
                                nextSibling === null &&
                                $isElementNode(parent) &&
                                parent.isInline() &&
                          Severity: Major
                          Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                              if (
                                nodeName === 'h1' ||
                                nodeName === 'h2' ||
                                nodeName === 'h3' ||
                                nodeName === 'h4' ||
                            Severity: Major
                            Found in resources/js/wysiwyg/lexical/rich-text/index.ts - About 40 mins to fix

                              Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      $name,
                                      UserProvider $provider,
                                      Session $session,
                                      LdapService $ldapService,
                                      RegistrationService $registrationService
                              Severity: Minor
                              Found in app/Access/Guards/LdapSessionGuard.php - About 35 mins to fix

                                Method resizeImageData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        string $imageData,
                                        ?int $width,
                                        ?int $height,
                                        bool $keepRatio,
                                        ?string $format = null,
                                Severity: Minor
                                Found in app/Uploads/ImageResizer.php - About 35 mins to fix

                                  Method resizeToThumbnailUrl has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          Image $image,
                                          ?int $width,
                                          ?int $height,
                                          bool $keepRatio = false,
                                          bool $shouldCreate = false
                                  Severity: Minor
                                  Found in app/Uploads/ImageResizer.php - About 35 mins to fix

                                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public function __construct(string $event, Webhook $webhook, string|Loggable $detail, User $initiator, int $initiatedTime)
                                    Severity: Minor
                                    Found in app/Activity/Tools/WebhookFormatter.php - About 35 mins to fix

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

                                      function showPopup(editor, code, language, direction, callback) {
                                      Severity: Minor
                                      Found in resources/js/wysiwyg-tinymce/plugin-codeeditor.js - About 35 mins to fix

                                        Method createJointPermissionData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            protected function createJointPermissionData(SimpleEntityData $entity, int $roleId, MassEntityPermissionEvaluator $permissionMap, array $rolePermissionMap, bool $isAdminRole): array
                                        Severity: Minor
                                        Found in app/Permissions/JointPermissionBuilder.php - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language