BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Function setup has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    setup() {
        this.elem = this.$el;
        this.editContainer = this.$refs.editContainer;
        this.input = this.$refs.input;

Severity: Minor
Found in resources/js/components/wysiwyg-editor.js - About 1 hr to fix

    Method getConnection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getConnection()
        {
            if ($this->ldapConnection !== null) {
                return $this->ldapConnection;
            }
    Severity: Minor
    Found in app/Access/LdapService.php - About 1 hr to fix

      Function buildForInput has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function buildForInput(options) {
          // Set language
          window.tinymce.addI18n(options.language, options.translationMap);
      
          // BookStack Version
      Severity: Minor
      Found in resources/js/wysiwyg-tinymce/config.js - About 1 hr to fix

        Function $mergeTableCellsInSelection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function $mergeTableCellsInSelection(selection: TableSelection): void {
            const selectionShape = selection.getShape();
            const cells = $getTableCellsFromSelection(selection);
            if (cells.length === 0) {
                return;
        Severity: Minor
        Found in resources/js/wysiwyg/utils/tables.ts - About 1 hr to fix

          Function syncPropertiesFromYjs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function syncPropertiesFromYjs(
            binding: Binding,
            sharedType: XmlText | YMap<unknown> | XmlElement,
            lexicalNode: LexicalNode,
            keysChanged: null | Set<string>,
          Severity: Minor
          Found in resources/js/wysiwyg/lexical/yjs/Utils.ts - About 1 hr to fix

            Function $deleteCellHandler has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const $deleteCellHandler = (
                event: KeyboardEvent | ClipboardEvent | null,
              ): boolean => {
                const selection = $getSelection();
            
            
            Severity: Minor
            Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 1 hr to fix

              Function adjustFocusNodeInDirection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const adjustFocusNodeInDirection = (
                tableObserver: TableObserver,
                tableNode: TableNode,
                x: number,
                y: number,
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/table/LexicalTableSelectionHelpers.ts - About 1 hr to fix

                Function exportDOM has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  exportDOM(editor: LexicalEditor): DOMExportOutput {
                    let {element} = super.exportDOM(editor);
                    invariant(
                      element !== null && isHTMLElement(element),
                      'Expected TextNode createDOM to always return a HTMLElement',
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts - About 1 hr to fix

                  Method processUsers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function processUsers(array $users, UserAvatars $userAvatar): int
                      {
                          $dryRun = !$this->option('force');
                          $this->info(count($users) . " user(s) found to update avatars for.");
                  
                  
                  Severity: Minor
                  Found in app/Console/Commands/RefreshAvatarCommand.php - About 1 hr to fix

                    Function setupDropTargetHandlers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        setupDropTargetHandlers() {
                            let depth = 0;
                    
                            const reset = () => {
                                this.hideOverlay();
                    Severity: Minor
                    Found in resources/js/components/dropzone.js - About 1 hr to fix

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

                          setupListeners() {
                              this.elem.addEventListener('click', this.onClick.bind(this));
                      
                              let lastSearch = 0;
                              this.searchInput.addEventListener('input', () => {
                      Severity: Minor
                      Found in resources/js/components/entity-selector.js - About 1 hr to fix

                        Function createUploadFromFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            createUploadFromFile(file) {
                                const {
                                    dom, status, progress, dismiss,
                                } = this.createDomForFile(file);
                                this.statusArea.append(dom);
                        Severity: Minor
                        Found in resources/js/components/dropzone.js - About 1 hr to fix

                          Method fromRequest has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function fromRequest(Request $request): self
                              {
                                  if (!$request->has('search') && !$request->has('term')) {
                                      return static::fromString('');
                                  }
                          Severity: Minor
                          Found in app/Search/SearchOptions.php - About 1 hr to fix

                            Function setupTestCase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  const setupTestCase = (
                                    cb: (selection: RangeSelection, el: ElementNode) => void,
                                  ) => {
                                    const editor = createTestEditor();
                            
                            

                              Function createRelativePosition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function createRelativePosition(
                                point: Point,
                                binding: Binding,
                              ): null | RelativePosition {
                                const collabNodeMap = binding.collabNodeMap;
                              Severity: Minor
                              Found in resources/js/wysiwyg/lexical/yjs/SyncCursors.ts - About 1 hr to fix

                                Function setupTestCase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      const setupTestCase = (
                                        cb: (selection: RangeSelection, el: ElementNode) => void,
                                      ) => {
                                        const editor = createTestEditor();
                                
                                

                                  Function setupTestCase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        const setupTestCase = (
                                          cb: (selection: RangeSelection, node: ElementNode) => void,
                                        ) => {
                                          const editor = createTestEditor();
                                  
                                  

                                    Function $shouldPreventDefaultAndInsertText has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function $shouldPreventDefaultAndInsertText(
                                      selection: RangeSelection,
                                      domTargetRange: null | StaticRange,
                                      text: string,
                                      timeStamp: number,
                                    Severity: Minor
                                    Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                if (
                                                  $isTextNode(node) &&
                                                  textContentSize !== 0 &&
                                                  // Exclude empty text nodes at boundaries resulting from user's selection
                                                  !(
                                      Severity: Critical
                                      Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                if (
                                                  anchor.type === 'element' &&
                                                  anchor.offset === 0 &&
                                                  selection.isCollapsed() &&
                                                  !$isRootNode(anchorNode) &&
                                        Severity: Critical
                                        Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language