BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Function getSetupCallback has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getSetupCallback(options) {
    return function setupCallback(editor) {
        function editorChange() {
            if (options.darkMode) {
                editor.contentDocument.documentElement.classList.add('dark-mode');
Severity: Minor
Found in resources/js/wysiwyg-tinymce/config.js - About 1 hr to fix

    Function handleDropdown has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function handleDropdown(options: HandleDropdownParams) {
        const {menu, toggle, onClose, onOpen, showOnHover} = options;
        let clickListener: Function|null = null;
    
        const hide = () => {
    Severity: Minor
    Found in resources/js/wysiwyg/ui/framework/helpers/dropdowns.ts - About 1 hr to fix

      Method show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function show(string $bookSlug, string $pageSlug)
          {
              try {
                  $page = $this->queries->findVisibleBySlugsOrFail($bookSlug, $pageSlug);
              } catch (NotFoundException $e) {
      Severity: Minor
      Found in app/Entities/Controllers/PageController.php - About 1 hr to fix

        Method loadModelsFromSortMap has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function loadModelsFromSortMap(BookSortMap $sortMap): array
            {
                $modelMap = [];
                $ids = [
                    'chapter' => [],
        Severity: Minor
        Found in app/Entities/Tools/BookContents.php - About 1 hr to fix

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

            updateDOM(
              prevNode: LinkNode,
              anchor: LinkHTMLElementType,
              config: EditorConfig,
            ): boolean {
          Severity: Minor
          Found in resources/js/wysiwyg/lexical/link/index.ts - About 1 hr to fix

            Function $handleNormalizationMergeConflicts has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function $handleNormalizationMergeConflicts(
              binding: Binding,
              normalizedNodes: Set<NodeKey>,
            ): void {
              // We handle the merge operations here
            Severity: Minor
            Found in resources/js/wysiwyg/lexical/yjs/SyncEditorStates.ts - About 1 hr to fix

              Function moveSelectionPointToSibling has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function moveSelectionPointToSibling(
                point: PointType,
                node: LexicalNode,
                parent: ElementNode,
                prevSibling: LexicalNode | null,
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 1 hr to fix

                Function simpleDiffWithCursor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function simpleDiffWithCursor(
                  a: string,
                  b: string,
                  cursor: number,
                ): {index: number; insert: string; remove: number} {
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/shared/simpleDiffWithCursor.ts - About 1 hr to fix

                  Function setupListeners has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      setupListeners() {
                          const keyboardNavHandler = new KeyboardNavigationHandler(this.container, event => {
                              this.hide();
                              this.toggle.focus();
                              if (!this.bubbleEscapes) {
                  Severity: Minor
                  Found in resources/js/components/dropdown.js - About 1 hr to fix

                    Function setupListeners has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        setupListeners() {
                            // Copy on copy button click
                            this.includeButton.addEventListener('click', () => copyTextToClipboard(this.includeInput.value));
                            this.linkButton.addEventListener('click', () => copyTextToClipboard(this.linkInput.value));
                    
                    
                    Severity: Minor
                    Found in resources/js/components/pointer.js - About 1 hr to fix

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

                          public function handle(PermissionsUpdater $permissionsUpdater, BookshelfQueries $queries): int
                          {
                              $shelfSlug = $this->option('slug');
                              $cascadeAll = $this->option('all');
                              $shelves = null;
                      Severity: Minor
                      Found in app/Console/Commands/CopyShelfPermissionsCommand.php - About 1 hr to fix

                        Function action has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            async action(formData, context: EditorUiContext) {
                                const selectedNode: MediaNode|null = await (new Promise((res, rej) => {
                                    context.editor.getEditorState().read(() => {
                                        const node = $getNodeFromSelection($getSelection(), $isMediaNode);
                                        res(node as MediaNode|null);
                        Severity: Minor
                        Found in resources/js/wysiwyg/ui/defaults/forms/objects.ts - About 1 hr to fix

                          Method renderUsingCommand has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function renderUsingCommand(string $html): string
                              {
                                  $command = config('exports.pdf_command');
                                  $inputHtml = tempnam(sys_get_temp_dir(), 'bs-pdfgen-html-');
                                  $outputPdf = tempnam(sys_get_temp_dir(), 'bs-pdfgen-output-');
                          Severity: Minor
                          Found in app/Entities/Tools/PdfGenerator.php - About 1 hr to fix

                            Method searchEntities has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function searchEntities(SearchOptions $searchOpts, string $entityType = 'all', int $page = 1, int $count = 20): array
                                {
                                    $entityTypes = array_keys($this->entityProvider->all());
                                    $entityTypesToSearch = $entityTypes;
                            
                            
                            Severity: Minor
                            Found in app/Search/SearchRunner.php - About 1 hr to fix

                              Function $syncEvent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function $syncEvent(binding: Binding, event: any): void {
                                const {target} = event;
                                const collabNode = $getOrInitCollabNodeFromSharedType(binding, target);
                              
                                if (collabNode instanceof CollabElementNode && event instanceof YTextEvent) {
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/yjs/SyncEditorStates.ts - About 1 hr to fix

                                Function $getOrInitCollabNodeFromSharedType has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function $getOrInitCollabNodeFromSharedType(
                                  binding: Binding,
                                  sharedType: XmlText | YMap<unknown> | XmlElement,
                                  parent?: CollabElementNode,
                                ):
                                Severity: Minor
                                Found in resources/js/wysiwyg/lexical/yjs/Utils.ts - About 1 hr to fix

                                  Function syncLexicalUpdateToYjs has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function syncLexicalUpdateToYjs(
                                    binding: Binding,
                                    provider: Provider,
                                    prevEditorState: EditorState,
                                    currEditorState: EditorState,
                                  Severity: Minor
                                  Found in resources/js/wysiwyg/lexical/yjs/SyncEditorStates.ts - About 1 hr to fix

                                    Function $removeSegment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function $removeSegment(
                                      node: TextNode,
                                      isBackward: boolean,
                                      offset: number,
                                    ): void {
                                    Severity: Minor
                                    Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 1 hr to fix

                                      Function collectBuildInformation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function collectBuildInformation(): string {
                                        let compatibleEditors = 0;
                                        const incompatibleEditors = new Set<string>();
                                        const thisVersion = LexicalEditor.version;
                                        if (typeof window !== 'undefined') {
                                      Severity: Minor
                                      Found in resources/js/wysiwyg/lexical/core/LexicalUpdates.ts - About 1 hr to fix

                                        Function setupCallback has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            return function setupCallback(editor) {
                                                function editorChange() {
                                                    if (options.darkMode) {
                                                        editor.contentDocument.documentElement.classList.add('dark-mode');
                                                    }
                                        Severity: Minor
                                        Found in resources/js/wysiwyg-tinymce/config.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language