BookStackApp/BookStack

View on GitHub

Showing 1,485 of 1,485 total issues

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

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

        createDOM(config: EditorConfig): HTMLElement {
            const dom = super.createDOM(config);
            updateElementWithCommonBlockProps(dom, this);
            return dom;
        }
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/custom-quote.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-heading.ts on lines 65..69
    resources/js/wysiwyg/nodes/custom-paragraph.ts on lines 65..69

    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 47.

    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 7 locations. Consider refactoring.
    Open

        static importDOM(): DOMConversionMap | null {
            return {
                tr: (node: Node) => ({
                    conversion: $convertTableRowElement,
                    priority: 0,
    Severity: Major
    Found in resources/js/wysiwyg/nodes/custom-table-row.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100

    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 47.

    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 S4 = () => (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
    Severity: Minor
    Found in resources/js/services/util.js and 1 other location - About 35 mins to fix
    resources/js/services/util.js on lines 94..94

    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 47.

    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 7 locations. Consider refactoring.
    Open

      static importDOM(): DOMConversionMap | null {
        return {
          tr: (node: Node) => ({
            conversion: $convertTableRowElement,
            priority: 0,
    Severity: Major
    Found in resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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 7 locations. Consider refactoring.
    Open

        static importDOM(): DOMConversionMap | null {
            return {
                blockquote: (node: Node) => ({
                    conversion: $convertBlockquoteElement,
                    priority: 0,
    Severity: Major
    Found in resources/js/wysiwyg/nodes/custom-quote.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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 7 locations. Consider refactoring.
    Open

      static importDOM(): DOMConversionMap | null {
        return {
          blockquote: (node: Node) => ({
            conversion: $convertBlockquoteElement,
            priority: 0,
    Severity: Major
    Found in resources/js/wysiwyg/lexical/rich-text/index.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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 7 locations. Consider refactoring.
    Open

      static importDOM(): DOMConversionMap | null {
        return {
          table: (_node: Node) => ({
            conversion: $convertTableElement,
            priority: 1,
    Severity: Major
    Found in resources/js/wysiwyg/lexical/table/LexicalTableNode.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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 S4 = () => (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
    Severity: Minor
    Found in resources/js/services/util.js and 1 other location - About 35 mins to fix
    resources/js/services/util.js on lines 83..83

    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 47.

    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

        createDOM(config: EditorConfig): HTMLElement {
            const dom = super.createDOM(config);
            updateElementWithCommonBlockProps(dom, this);
            return dom;
        }
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/custom-paragraph.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-heading.ts on lines 65..69
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 66..70

    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 47.

    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 7 locations. Consider refactoring.
    Open

      static importDOM(): DOMConversionMap | null {
        return {
          p: (node: Node) => ({
            conversion: $convertParagraphElement,
            priority: 0,
    resources/js/wysiwyg/lexical/link/index.ts on lines 148..155
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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

        createDOM(config: EditorConfig): HTMLElement {
            const dom = super.createDOM(config);
            updateElementWithCommonBlockProps(dom, this);
            return dom;
        }
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/custom-heading.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-paragraph.ts on lines 65..69
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 66..70

    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 47.

    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 7 locations. Consider refactoring.
    Open

      static importDOM(): DOMConversionMap | null {
        return {
          a: (node: Node) => ({
            conversion: $convertAnchorElement,
            priority: 1,
    Severity: Major
    Found in resources/js/wysiwyg/lexical/link/index.ts and 6 other locations - About 35 mins to fix
    resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts on lines 118..125
    resources/js/wysiwyg/lexical/rich-text/index.ts on lines 142..149
    resources/js/wysiwyg/lexical/table/LexicalTableNode.ts on lines 45..52
    resources/js/wysiwyg/lexical/table/LexicalTableRowNode.ts on lines 45..52
    resources/js/wysiwyg/nodes/custom-quote.ts on lines 93..100
    resources/js/wysiwyg/nodes/custom-table-row.ts on lines 63..70

    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 47.

    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 4 locations. Consider refactoring.
    Open

        window.$events.listen<EditorEventContent>('editor::replace', eventContent => {
            const html = getContentToInsert(eventContent);
            setEditorContentFromHtml(editor, html);
        });
    Severity: Major
    Found in resources/js/wysiwyg/services/common-events.ts and 3 other locations - About 35 mins to fix
    resources/js/wysiwyg/services/common-events.ts on lines 25..28
    resources/js/wysiwyg/services/common-events.ts on lines 30..33
    resources/js/wysiwyg/services/common-events.ts on lines 35..38

    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 47.

    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

        exportJSON(): SerializedHorizontalRuleNode {
            return {
                ...super.exportJSON(),
                type: 'horizontal-rule',
                version: 1,
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/horizontal-rule.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-list.ts on lines 58..65
    resources/js/wysiwyg/nodes/details.ts on lines 82..89

    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 47.

    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

        static importJSON(serializedNode: SerializedCalloutNode): CalloutNode {
            const node = $createCalloutNode(serializedNode.category);
            deserializeCommonBlockNode(serializedNode, node);
            return node;
        }
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/callout.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-heading.ts on lines 87..91
    resources/js/wysiwyg/nodes/media.ts on lines 316..320

    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 47.

    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

        static importJSON(serializedNode: SerializedMediaNode): MediaNode {
            const node = $createMediaNode(serializedNode.tag);
            deserializeCommonBlockNode(serializedNode, node);
            return node;
        }
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/media.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/callout.ts on lines 160..164
    resources/js/wysiwyg/nodes/custom-heading.ts on lines 87..91

    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 47.

    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

        exportJSON(): SerializedCustomListNode {
            return {
                ...super.exportJSON(),
                type: 'custom-list',
                version: 1,
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/custom-list.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/details.ts on lines 82..89
    resources/js/wysiwyg/nodes/horizontal-rule.ts on lines 69..76

    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 47.

    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

        exportJSON(): SerializedDetailsNode {
            return {
                ...super.exportJSON(),
                type: 'details',
                version: 1,
    Severity: Minor
    Found in resources/js/wysiwyg/nodes/details.ts and 2 other locations - About 35 mins to fix
    resources/js/wysiwyg/nodes/custom-list.ts on lines 58..65
    resources/js/wysiwyg/nodes/horizontal-rule.ts on lines 69..76

    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 47.

    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 4 locations. Consider refactoring.
    Open

        window.$events.listen<EditorEventContent>('editor::insert', eventContent => {
            const html = getContentToInsert(eventContent);
            insertHtmlIntoEditor(editor, html);
        });
    Severity: Major
    Found in resources/js/wysiwyg/services/common-events.ts and 3 other locations - About 35 mins to fix
    resources/js/wysiwyg/services/common-events.ts on lines 20..23
    resources/js/wysiwyg/services/common-events.ts on lines 25..28
    resources/js/wysiwyg/services/common-events.ts on lines 30..33

    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 47.

    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