BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Method orientImageToOriginalExif has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function orientImageToOriginalExif(InterventionImage $image, string $originalData): void
    {
        if (!extension_loaded('exif')) {
            return;
        }
Severity: Minor
Found in app/Uploads/ImageResizer.php - About 1 hr to fix

    Method handleLoginCallback has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handleLoginCallback(string $socialDriver, SocialUser $socialUser)
        {
            $socialDriver = trim(strtolower($socialDriver));
            $socialId = $socialUser->getId();
    
    
    Severity: Minor
    Found in app/Access/SocialAuthService.php - About 1 hr to fix

      Method registerUser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function registerUser(array $userData, ?SocialAccount $socialAccount = null, bool $emailConfirmed = false): User
          {
              $userEmail = $userData['email'];
              $authSystem = $socialAccount ? $socialAccount->driver : auth()->getDefaultDriver();
      
      
      Severity: Minor
      Found in app/Access/RegistrationService.php - About 1 hr to fix

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

        function detailsDialog(editor) {
            return {
                title: 'Edit collapsible block',
                body: {
                    type: 'panel',
        Severity: Minor
        Found in resources/js/wysiwyg-tinymce/plugins-details.js - About 1 hr to fix

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

          function createDropListener(context: EditorUiContext): (event: DragEvent) => boolean {
              const editor = context.editor;
              return (event: DragEvent): boolean => {
                  // Template handling
                  const templateId = event.dataTransfer?.getData('bookstack/template') || '';
          Severity: Minor
          Found in resources/js/wysiwyg/services/drop-paste-handling.ts - About 1 hr to fix

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

                protected buildDOM(): HTMLElement {
                    const controls: HTMLElement[] = [];
                    const contents: HTMLElement[] = [];
            
                    const selectTab = (tabIndex: number) => {
            Severity: Minor
            Found in resources/js/wysiwyg/ui/framework/forms.ts - About 1 hr to fix

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

              export function $createCollabNodeFromLexicalNode(
                binding: Binding,
                lexicalNode: LexicalNode,
                parent: CollabElementNode,
              ):
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/yjs/Utils.ts - About 1 hr to fix

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

                export function $dfs(
                  startingNode?: LexicalNode,
                  endingNode?: LexicalNode,
                ): Array<DFSNode> {
                  const nodes = [];
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/utils/index.ts - About 1 hr to fix

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

                    function restart(): void {
                      const currentRootDOMNode = editor.getRootElement();
                      if (currentRootDOMNode === null) {
                        return stop();
                      }
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/utils/positionNodeOnRange.ts - About 1 hr to fix

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

                    export function $getNodeTriplet(
                      source: PointType | LexicalNode | TableCellNode,
                    ): [TableCellNode, TableRowNode, TableNode] {
                      let cell: TableCellNode;
                      if (source instanceof TableCellNode) {
                    Severity: Minor
                    Found in resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts - About 1 hr to fix

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

                      export function $createTableNodeWithDimensions(
                        rowCount: number,
                        columnCount: number,
                        includeHeaders: InsertTableCommandPayloadHeaders = true,
                      ): TableNode {
                      Severity: Minor
                      Found in resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts - About 1 hr to fix

                        Function saveDraft has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            async saveDraft() {
                                const data = {name: this.titleElem.value.trim()};
                        
                                const editorContent = await this.getEditorComponent().getContent();
                                Object.assign(data, editorContent);
                        Severity: Minor
                        Found in resources/js/components/page-editor.js - About 1 hr to fix

                          Method processLoginCallback has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function processLoginCallback(string $samlID, array $samlAttributes): User
                              {
                                  $userDetails = $this->getUserDetails($samlID, $samlAttributes);
                                  $isLoggedIn = auth()->check();
                          
                          
                          Severity: Minor
                          Found in app/Access/Saml2Service.php - About 1 hr to fix

                            Method getUserDetailsFromToken has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getUserDetailsFromToken(OidcIdToken $idToken, OidcAccessToken $accessToken, OidcProviderSettings $settings): OidcUserDetails
                                {
                                    $userDetails = new OidcUserDetails();
                                    $userDetails->populate(
                                        $idToken,
                            Severity: Minor
                            Found in app/Access/Oidc/OidcService.php - About 1 hr to fix

                              Method update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function update(Request $request, int $id)
                                  {
                                      $this->preventAccessInDemoMode();
                                      $this->checkPermission('users-manage');
                              
                              
                              Severity: Minor
                              Found in app/Users/Controllers/UserController.php - About 1 hr to fix

                                Method loadSettingsFromIssuerDiscovery has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function loadSettingsFromIssuerDiscovery(ClientInterface $httpClient): array
                                    {
                                        $issuerUrl = rtrim($this->issuer, '/') . '/.well-known/openid-configuration';
                                        $request = new Request('GET', $issuerUrl);
                                        $response = $httpClient->sendRequest($request);
                                Severity: Minor
                                Found in app/Access/Oidc/OidcProviderSettings.php - About 1 hr to fix

                                  Function $setInsetForSelection has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function $setInsetForSelection(editor: LexicalEditor, change: number): void {
                                      const selection = $getSelection();
                                      const listItemsInSelection = getListItemsForSelection(selection);
                                      const isListSelection = listItemsInSelection.length > 0 && !listItemsInSelection.includes(null);
                                  
                                  
                                  Severity: Minor
                                  Found in resources/js/wysiwyg/utils/lists.ts - About 1 hr to fix

                                    Method containHtml has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function containHtml(string $htmlContent): string
                                        {
                                            $imageTagsOutput = [];
                                            preg_match_all("/\<img.*?src\=(\'|\")(.*?)(\'|\").*?\>/i", $htmlContent, $imageTagsOutput);
                                    
                                    
                                    Severity: Minor
                                    Found in app/Entities/Tools/ExportFormatter.php - About 1 hr to fix

                                      Function collapseAtStart has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        collapseAtStart(selection: RangeSelection): true {
                                          const paragraph = $createParagraphNode();
                                          const children = this.getChildren();
                                          children.forEach((child) => paragraph.append(child));
                                          const listNode = this.getParentOrThrow();
                                      Severity: Minor
                                      Found in resources/js/wysiwyg/lexical/list/LexicalListItemNode.ts - About 1 hr to fix

                                        Function applyDOMRange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          applyDOMRange(range: StaticRange): void {
                                            const editor = getActiveEditor();
                                            const currentEditorState = editor.getEditorState();
                                            const lastSelection = currentEditorState._selection;
                                            const resolvedSelectionPoints = $internalResolveSelectionPoints(
                                        Severity: Minor
                                        Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language