BookStackApp/BookStack

View on GitHub
resources/js/wysiwyg/services/drop-paste-handling.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function handleMediaInsert has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function handleMediaInsert(data: DataTransfer, context: EditorUiContext): boolean {
    const clipboard = new Clipboard(data);
    let handled = false;

    // Don't handle the event ourselves if no items exist of contains table-looking data
Severity: Minor
Found in resources/js/wysiwyg/services/drop-paste-handling.ts - About 1 hr to fix

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

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

      There are no issues that match your filters.

      Category
      Status