BookStackApp/BookStack

View on GitHub

Showing 889 of 1,485 total issues

Function $insertTableColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  tableNode: TableNode,
  targetIndex: number,
  shouldInsertAfter = true,
  columnCount: number,
  table: TableDOMTable,
Severity: Minor
Found in resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts - About 35 mins to fix

    Function moveSelectionPointToSibling has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      point: PointType,
      node: LexicalNode,
      parent: ElementNode,
      prevSibling: LexicalNode | null,
      nextSibling: LexicalNode | null,
    Severity: Minor
    Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 35 mins to fix

      Function adjustPointOffsetForMergedSibling has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        point: PointType,
        isBefore: boolean,
        key: NodeKey,
        target: TextNode,
        textLength: number,
      Severity: Minor
      Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 35 mins to fix

        Function markCollapsedSelectionFormat has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          format: number,
          style: string,
          offset: number,
          key: NodeKey,
          timeStamp: number,
        Severity: Minor
        Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 35 mins to fix

          Function $shouldPreventDefaultAndInsertText has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            selection: RangeSelection,
            domTargetRange: null | StaticRange,
            text: string,
            timeStamp: number,
            isBeforeInput: boolean,
          Severity: Minor
          Found in resources/js/wysiwyg/lexical/core/LexicalEvents.ts - About 35 mins to fix

            Function $updateTextNodeFromDOMContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              textNode: TextNode,
              textContent: string,
              anchorOffset: null | number,
              focusOffset: null | number,
              compositionEnd: boolean,
            Severity: Minor
            Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

              Function setTextThemeClassNames has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                tag: string,
                prevFormat: number,
                nextFormat: number,
                dom: HTMLElement,
                textClassNames: TextNodeThemeClasses,
              Severity: Minor
              Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts - About 35 mins to fix

                Function isDeleteForward has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  key: string,
                  ctrlKey: boolean,
                  shiftKey: boolean,
                  altKey: boolean,
                  metaKey: boolean,
                Severity: Minor
                Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                  Function isMoveToStart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    key: string,
                    ctrlKey: boolean,
                    shiftKey: boolean,
                    altKey: boolean,
                    metaKey: boolean,
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                    Function triggerMutationListeners has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      editor: LexicalEditor,
                      mutatedNodes: MutatedNodes,
                      updateTags: Set<string>,
                      dirtyLeaves: Set<string>,
                      prevEditorState: EditorState,
                    Severity: Minor
                    Found in resources/js/wysiwyg/lexical/core/LexicalUpdates.ts - About 35 mins to fix

                      Function setMutatedNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        mutatedNodes: MutatedNodes,
                        registeredNodes: RegisteredNodes,
                        mutationListeners: MutationListeners,
                        node: LexicalNode,
                        mutation: NodeMutation,
                      Severity: Minor
                      Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                        Function isMoveToEnd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          key: string,
                          ctrlKey: boolean,
                          shiftKey: boolean,
                          altKey: boolean,
                          metaKey: boolean,
                        Severity: Minor
                        Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 35 mins to fix

                          Function handleLoginCallback has a Cognitive Complexity of 7 (exceeds 5 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 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function rebuildForEntity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function rebuildForEntity(Entity $entity)
                              {
                                  $entities = [$entity];
                                  if ($entity instanceof Book) {
                                      $books = $this->bookFetchQuery()->where('id', '=', $entity->id)->get();
                          Severity: Minor
                          Found in app/Permissions/JointPermissionBuilder.php - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function loadFromJwkArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function loadFromJwkArray(array $jwk)
                              {
                                  // 'alg' is optional for a JWK, but we will still attempt to validate if
                                  // it exists otherwise presume it will be compatible.
                                  $alg = $jwk['alg'] ?? null;
                          Severity: Minor
                          Found in app/Access/Oidc/OidcJwtSigningKey.php - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function attempt has a Cognitive Complexity of 7 (exceeds 5 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 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function selectItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              selectItem(item) {
                                  const isDblClick = this.isDoubleClick();
                                  const type = item.getAttribute('data-entity-type');
                                  const id = item.getAttribute('data-entity-id');
                                  const isSelected = (!item.classList.contains('selected') || isDblClick);
                          Severity: Minor
                          Found in resources/js/components/entity-selector.js - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function createManyJointPermissions has a Cognitive Complexity of 7 (exceeds 5 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 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function validate(): void
                              {
                                  $this->validateInitial();
                          
                                  $required = ['keys', 'tokenEndpoint', 'authorizationEndpoint'];
                          Severity: Minor
                          Found in app/Access/Oidc/OidcProviderSettings.php - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function filterElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected static function filterElement(DOMElement $element): void
                              {
                                  $elType = strtolower($element->tagName);
                                  $allowedAttrs = static::$allowedAttrsByElements[$elType] ?? null;
                                  if (is_null($allowedAttrs)) {
                          Severity: Minor
                          Found in app/Util/HtmlDescriptionFilter.php - About 35 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language