BookStackApp/BookStack

View on GitHub

Showing 1,485 of 1,485 total issues

Avoid too many return statements within this function.
Open

            return;
Severity: Major
Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return new RangeSelection(
        resolvedAnchorPoint,
        resolvedFocusPoint,
        !$isRangeSelection(lastSelection) ? 0 : lastSelection.format,
        !$isRangeSelection(lastSelection) ? '' : lastSelection.style,
    Severity: Major
    Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return OTHER;
      Severity: Major
      Found in resources/js/wysiwyg/lexical/history/index.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return;
        Severity: Major
        Found in resources/js/wysiwyg/lexical/core/LexicalSelection.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return OTHER;
          Severity: Major
          Found in resources/js/wysiwyg/lexical/history/index.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return null;
            Severity: Major
            Found in resources/js/wysiwyg/lexical/core/shared/caretFromPoint.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return false;
              Severity: Major
              Found in resources/js/wysiwyg/lexical/core/LexicalUtils.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return null;
                Severity: Major
                Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts - About 30 mins to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          run(elem, parent) {
                              const nextChapter = this.getNextChapter(elem, parent);
                              nextChapter.querySelector('ul').prepend(elem);
                          },
                  Severity: Minor
                  Found in resources/js/components/book-sort.js and 1 other location - About 30 mins to fix
                  resources/js/components/book-sort.js on lines 102..105

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          run(elem, parent) {
                              const prevChapter = this.getPrevChapter(elem, parent);
                              prevChapter.querySelector('ul').append(elem);
                          },
                  Severity: Minor
                  Found in resources/js/components/book-sort.js and 1 other location - About 30 mins to fix
                  resources/js/components/book-sort.js on lines 87..90

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                    destroy(binding: Binding): void {
                      const collabNodeMap = binding.collabNodeMap;
                      collabNodeMap.delete(this._key);
                    }
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/yjs/CollabTextNode.ts and 2 other locations - About 30 mins to fix
                  resources/js/wysiwyg/lexical/yjs/CollabDecoratorNode.ts on lines 96..99
                  resources/js/wysiwyg/lexical/yjs/CollabLineBreakNode.ts on lines 55..58

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                    destroy(binding: Binding): void {
                      const collabNodeMap = binding.collabNodeMap;
                      collabNodeMap.delete(this._key);
                    }
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/yjs/CollabDecoratorNode.ts and 2 other locations - About 30 mins to fix
                  resources/js/wysiwyg/lexical/yjs/CollabLineBreakNode.ts on lines 55..58
                  resources/js/wysiwyg/lexical/yjs/CollabTextNode.ts on lines 163..166

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                    destroy(binding: Binding): void {
                      const collabNodeMap = binding.collabNodeMap;
                      collabNodeMap.delete(this._key);
                    }
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/yjs/CollabLineBreakNode.ts and 2 other locations - About 30 mins to fix
                  resources/js/wysiwyg/lexical/yjs/CollabDecoratorNode.ts on lines 96..99
                  resources/js/wysiwyg/lexical/yjs/CollabTextNode.ts on lines 163..166

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                    const update = async (updateFn: () => void) => {
                      editor.update(updateFn);
                      await Promise.resolve();
                    };
                  resources/js/wysiwyg/lexical/utils/__tests__/unit/LexlcaiUtilsInsertNodeToNearestRoot.test.ts on lines 28..31

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                          expect(
                            headingNode.createDOM({
                              namespace: '',
                              theme: {
                                heading: {},
                  resources/js/wysiwyg/lexical/list/__tests__/unit/LexicalListNode.test.ts on lines 85..92
                  resources/js/wysiwyg/lexical/list/__tests__/unit/LexicalListNode.test.ts on lines 133..140

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    isUnmergeable(): boolean {
                      const self = this.getLatest();
                      return (self.__detail & IS_UNMERGEABLE) !== 0;
                    }
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts and 1 other location - About 30 mins to fix
                  resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts on lines 401..404

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                            const element = $findMatchingParent(
                              node,
                              (parentNode): parentNode is ElementNode =>
                                $isElementNode(parentNode) && !parentNode.isInline(),
                            );
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/rich-text/index.ts and 1 other location - About 30 mins to fix
                  resources/js/wysiwyg/lexical/rich-text/index.ts on lines 510..514

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      getWidth(): number {
                          const self = this.getLatest();
                          return sizeToPixels(self.__attributes.width || '0');
                      }
                  Severity: Minor
                  Found in resources/js/wysiwyg/nodes/media.ts and 1 other location - About 30 mins to fix
                  resources/js/wysiwyg/nodes/media.ts on lines 192..195

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                            if (segment.isWordLike) {
                              index = nextIndex;
                              foundWordNode = true;
                            } else if (foundWordNode) {
                              break;
                  Severity: Minor
                  Found in resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts and 1 other location - About 30 mins to fix
                  resources/js/wysiwyg/lexical/selection/__tests__/utils/index.ts on lines 183..190

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                    const update = async (updateFn: () => void) => {
                      editor.update(updateFn);
                      await Promise.resolve();
                    };
                  resources/js/wysiwyg/lexical/utils/__tests__/unit/LexicalUtilsSplitNode.test.ts on lines 20..23

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language