BookStackApp/BookStack

View on GitHub
resources/js/components/dropzone.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function createUploadFromFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    createUploadFromFile(file) {
        const {
            dom, status, progress, dismiss,
        } = this.createDomForFile(file);
        this.statusArea.append(dom);
Severity: Minor
Found in resources/js/components/dropzone.js - About 1 hr to fix

    Function setupDropTargetHandlers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setupDropTargetHandlers() {
            let depth = 0;
    
            const reset = () => {
                this.hideOverlay();
    Severity: Minor
    Found in resources/js/components/dropzone.js - 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

        There are no issues that match your filters.

        Category
        Status