BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

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

    updateDOM(prevNode: ImageNode, dom: HTMLElement) {
        if (prevNode.__src !== this.__src) {
            dom.setAttribute('src', this.__src);
        }

Severity: Minor
Found in resources/js/wysiwyg/nodes/image.ts - About 1 hr to fix

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

    function $pasteClipboardColumns(editor: LexicalEditor, isBefore: boolean): void {
        const selection = $getSelection();
        const table = $getTableFromSelection(selection);
        const cells = $getTableCellsFromSelection(selection);
        const referenceCell = cells[isBefore ? 0 : cells.length - 1];
    Severity: Minor
    Found in resources/js/wysiwyg/utils/table-copy-paste.ts - About 1 hr to fix

      Method getConverterEnvironment has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getConverterEnvironment(): Environment
          {
              $environment = new Environment([
                  'header_style'            => 'atx', // Set to 'atx' to output H1 and H2 headers as # Header1 and ## Header2
                  'suppress_errors'         => true, // Set to false to show warnings when loading malformed HTML
      Severity: Minor
      Found in app/Entities/Tools/Markdown/HtmlToMarkdown.php - About 1 hr to fix

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

            protected updateContextToolbars(update: EditorUiStateUpdate): void {
                for (let i = this.activeContextToolbars.length - 1; i >= 0; i--) {
                    const toolbar = this.activeContextToolbars[i];
                    toolbar.destroy();
                    this.activeContextToolbars.splice(i, 1);
        Severity: Minor
        Found in resources/js/wysiwyg/ui/framework/manager.ts - About 1 hr to fix

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

          export function $syncLocalCursorPosition(
            binding: Binding,
            provider: Provider,
          ): void {
            const awareness = provider.awareness;
          Severity: Minor
          Found in resources/js/wysiwyg/lexical/yjs/SyncCursors.ts - About 1 hr to fix

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

            export function $setBlocksType(
              selection: BaseSelection | null,
              createElement: () => ElementNode,
            ): void {
              if (selection === null) {
            Severity: Minor
            Found in resources/js/wysiwyg/lexical/selection/range-selection.ts - About 1 hr to fix

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

              function $createListOrMerge(node: ElementNode, listType: ListType): ListNode {
                if ($isListNode(node)) {
                  return node;
                }
              
              
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/list/formatList.ts - About 1 hr to fix

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

                function $splitNodeAtPoint(
                  node: LexicalNode,
                  offset: number,
                ): [parent: ElementNode, offset: number] {
                  const parent = node.getParent();
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 1 hr to fix

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

                  function processNestedUpdates(
                    editor: LexicalEditor,
                    initialSkipTransforms?: boolean,
                  ): boolean {
                    const queuedUpdates = editor._updates;
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/core/LexicalUpdates.ts - About 1 hr to fix

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

                      registerCommand<P>(
                        command: LexicalCommand<P>,
                        listener: CommandListener<P>,
                        priority: CommandListenerPriority,
                      ): () => void {
                    Severity: Minor
                    Found in resources/js/wysiwyg/lexical/core/LexicalEditor.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 setup has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            setup() {
                                this.elem = this.$el;
                        
                                this.pageId = this.$opts.pageId;
                                this.textDirection = this.$opts.textDirection;
                        Severity: Minor
                        Found in resources/js/components/markdown-editor.js - About 1 hr to fix

                          Method queryWithTotals has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function queryWithTotals(SimpleListOptions $listOptions, string $nameFilter): Builder
                              {
                                  $searchTerm = $listOptions->getSearch();
                                  $sort = $listOptions->getSort();
                                  if ($sort === 'name' && $nameFilter) {
                          Severity: Minor
                          Found in app/Activity/TagRepo.php - About 1 hr to fix

                            Method saveNew has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function saveNew(string $imageName, string $imageData, string $type, int $uploadedTo = 0): Image
                                {
                                    $disk = $this->storage->getDisk($type);
                                    $secureUploads = setting('app-secure-images');
                                    $fileName = $this->storage->cleanImageFileName($imageName);
                            Severity: Minor
                            Found in app/Uploads/ImageService.php - About 1 hr to fix

                              Method handle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function handle(UserRepo $userRepo): int
                                  {
                                      $details = $this->snakeCaseOptions();
                              
                                      if (empty($details['email'])) {
                              Severity: Minor
                              Found in app/Console/Commands/CreateAdminCommand.php - About 1 hr to fix

                                Function build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            build() {
                                                return new EditorFormTabs([
                                                    {
                                                        label: 'General',
                                                        contents: [
                                Severity: Minor
                                Found in resources/js/wysiwyg/ui/defaults/forms/objects.ts - About 1 hr to fix

                                  Method applySortUpdates has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function applySortUpdates(BookSortMapItem $sortMapItem, array $modelMap): void
                                      {
                                          /** @var BookChild $model */
                                          $model = $modelMap[$sortMapItem->type . ':' . $sortMapItem->id] ?? null;
                                          if (!$model) {
                                  Severity: Minor
                                  Found in app/Entities/Tools/BookContents.php - About 1 hr to fix

                                    Method build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function build(): array
                                        {
                                            $page = clone $this->page;
                                            $isDraft = boolval($this->page->draft);
                                            $templates = $this->queries->pages->visibleTemplates()
                                    Severity: Minor
                                    Found in app/Entities/Tools/PageEditorData.php - About 1 hr to fix

                                      Function $onCompositionEndImpl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function $onCompositionEndImpl(editor: LexicalEditor, data?: string): void {
                                        const compositionKey = editor._compositionKey;
                                        $setCompositionKey(null);
                                      
                                        // Handle termination of composition.
                                      Severity: Minor
                                      Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 1 hr to fix

                                        Function findTextInLine has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function findTextInLine(text: Text, forward: boolean): null | Text {
                                          let node: Node = text;
                                          // eslint-disable-next-line no-constant-condition
                                          while (true) {
                                            let sibling: null | Node;
                                        Severity: Minor
                                        Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language