BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Function initializeConversionCache has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function initializeConversionCache(
  nodes: RegisteredNodes,
  additionalConversions?: DOMConversionMap,
): DOMConversionCache {
  const conversionCache = new Map();
Severity: Minor
Found in resources/js/wysiwyg/lexical/core/LexicalEditor.ts - About 1 hr to fix

    Function $handleIndentAndOutdent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function $handleIndentAndOutdent(
      indentOrOutdent: (block: ElementNode) => void,
    ): boolean {
      const selection = $getSelection();
      if (!$isRangeSelection(selection)) {
    Severity: Minor
    Found in resources/js/wysiwyg/lexical/rich-text/index.ts - About 1 hr to fix

      Method validateTokenClaims has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function validateTokenClaims(string $clientId): void
          {
              // 1. The Issuer Identifier for the OpenID Provider (which is typically obtained during Discovery)
              // MUST exactly match the value of the iss (issuer) Claim.
              // Already done in parent.
      Severity: Minor
      Found in app/Access/Oidc/OidcIdToken.php - About 1 hr to fix

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

            setupListeners() {
                const navHandler = new KeyboardNavigationHandler(
                    this.list,
                    () => {
                        this.input.focus();
        Severity: Minor
        Found in resources/js/components/auto-suggest.js - About 1 hr to fix

          Function saveComment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              saveComment(event) {
                  event.preventDefault();
                  event.stopPropagation();
          
                  const loading = getLoading();
          Severity: Minor
          Found in resources/js/components/page-comments.js - About 1 hr to fix

            Method store has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function store(Request $request)
                {
                    $this->checkPermission('users-manage');
            
                    $authMethod = config('auth.method');
            Severity: Minor
            Found in app/Users/Controllers/UserController.php - About 1 hr to fix

              Function createDomForFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  createDomForFile(file) {
                      const image = elem('img', {src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.224 7.373a.924.924 0 0 0-.92.925l-.006 7.404c0 .509.412.925.921.925h5.557a.928.928 0 0 0 .926-.925v-5.553l-2.777-2.776Zm3.239 3.239V8.067l2.545 2.545z' style='fill:%23000;fill-opacity:.75'/%3E%3C/svg%3E"});
                      const status = elem('div', {class: 'dropzone-file-item-status'}, []);
                      const progress = elem('div', {class: 'dropzone-file-item-progress'});
                      const imageWrap = elem('div', {class: 'dropzone-file-item-image-wrap'}, [image]);
              Severity: Minor
              Found in resources/js/components/dropzone.js - About 1 hr to fix

                Function paste has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function paste(editor, options, event) {
                    const clipboard = new Clipboard(event.clipboardData || event.dataTransfer);
                
                    // Don't handle the event ourselves if no items exist of contains table-looking data
                    if (!clipboard.hasItems() || clipboard.containsTabularData()) {
                Severity: Minor
                Found in resources/js/wysiwyg-tinymce/drop-paste-handling.js - About 1 hr to fix

                  Method createManyJointPermissions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function createManyJointPermissions(array $originalEntities, array $roles)
                      {
                          $entities = $this->entitiesToSimpleEntities($originalEntities);
                          $jointPermissions = [];
                  
                  
                  Severity: Minor
                  Found in app/Permissions/JointPermissionBuilder.php - About 1 hr to fix

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

                        setup() {
                            // Options
                            this.uploadedTo = this.$opts.uploadedTo;
                    
                            // Element References
                    Severity: Minor
                    Found in resources/js/components/image-manager.js - About 1 hr to fix

                      Method attempt has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function attempt(array $credentials = [], $remember = false)
                          {
                              $username = $credentials['username'];
                              $userDetails = $this->ldapService->getUserDetails($username);
                      
                      
                      Severity: Minor
                      Found in app/Access/Guards/LdapSessionGuard.php - About 1 hr to fix

                        Function wrapContinuousInlines has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function wrapContinuousInlines(
                          domNode: Node,
                          nodes: Array<LexicalNode>,
                          createWrapperFn: () => ElementNode,
                        ): Array<LexicalNode> {
                        Severity: Minor
                        Found in resources/js/wysiwyg/lexical/html/index.ts - About 1 hr to fix

                          Function importDOM has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              static importDOM(): DOMConversionMap | null {
                                  return {
                                      h1: (node: Node) => ({
                                          conversion: $convertHeadingElement,
                                          priority: 0,
                          Severity: Minor
                          Found in resources/js/wysiwyg/nodes/custom-heading.ts - About 1 hr to fix

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

                                async action(formData, context: EditorUiContext) {
                                    context.editor.update(() => {
                                        const table = $getTableFromSelection($getSelection());
                                        if (!table) {
                                            return;
                            Severity: Minor
                            Found in resources/js/wysiwyg/ui/defaults/forms/tables.ts - About 1 hr to fix

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

                                  public function show(Request $request, ActivityQueries $activities, string $slug)
                                  {
                                      $shelf = $this->queries->findVisibleBySlugOrFail($slug);
                                      $this->checkOwnablePermission('bookshelf-view', $shelf);
                              
                              
                              Severity: Minor
                              Found in app/Entities/Controllers/BookshelfController.php - About 1 hr to fix

                                Function forChild has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        forChild: (lexicalNode, parentLexicalNode) => {
                                            if ($isTableCellNode(parentLexicalNode) && !$isElementNode(lexicalNode)) {
                                                const paragraphNode = $createParagraphNode();
                                                if (
                                                    $isLineBreakNode(lexicalNode) &&
                                Severity: Minor
                                Found in resources/js/wysiwyg/nodes/custom-table-cell.ts - About 1 hr to fix

                                  Function getLastTextNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function getLastTextNode(startingNode: Node) {
                                    let node = startingNode;
                                  
                                    mainLoop: while (node !== null) {
                                      if (node !== startingNode && node.nodeType === 3) {
                                  Severity: Minor
                                  Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts - About 1 hr to fix

                                    Function getNextTextNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function getNextTextNode(startingNode: Node) {
                                      let node = startingNode;
                                    
                                      mainLoop: while (node !== null) {
                                        if (node !== startingNode && node.nodeType === 3) {
                                    Severity: Minor
                                    Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts - About 1 hr to fix

                                      Function forChild has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          forChild: (lexicalNode, parentLexicalNode) => {
                                            if ($isTableCellNode(parentLexicalNode) && !$isElementNode(lexicalNode)) {
                                              const paragraphNode = $createParagraphNode();
                                              if (
                                                $isLineBreakNode(lexicalNode) &&
                                      Severity: Minor
                                      Found in resources/js/wysiwyg/lexical/table/LexicalTableCellNode.ts - About 1 hr to fix

                                        Function choice has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            choice(translation: string, count: number, replacements: Record<string, string> = {}): string {
                                                const splitText = translation.split('|');
                                                const exactCountRegex = /^{([0-9]+)}/;
                                                const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;
                                                let result = null;
                                        Severity: Minor
                                        Found in resources/js/services/translations.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language