BookStackApp/BookStack

View on GitHub
resources/js/wysiwyg/config.js

Summary

Maintainability
C
1 day
Test Coverage

File config.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {register as registerShortcuts} from './shortcuts';
import {listen as listenForCommonEvents} from './common-events';
import {scrollToQueryString} from './scrolling';
import {listenForDragAndPaste} from './drop-paste-handling';
import {getPrimaryToolbar, registerAdditionalToolbars} from './toolbars';
Severity: Minor
Found in resources/js/wysiwyg/config.js - About 3 hrs to fix

    Function buildForEditor has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function buildForEditor(options) {
        // Set language
        window.tinymce.addI18n(options.language, options.translationMap);
    
        // BookStack Version
    Severity: Major
    Found in resources/js/wysiwyg/config.js - About 2 hrs to fix

      Function buildForInput has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function buildForInput(options) {
          // Set language
          window.tinymce.addI18n(options.language, options.translationMap);
      
          // BookStack Version
      Severity: Minor
      Found in resources/js/wysiwyg/config.js - About 1 hr to fix

        Function gatherPlugins has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function gatherPlugins(options) {
            const plugins = [
                'image',
                'table',
                'link',
        Severity: Minor
        Found in resources/js/wysiwyg/config.js - About 1 hr to fix

          Function getSetupCallback has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function getSetupCallback(options) {
              return function setupCallback(editor) {
                  function editorChange() {
                      if (options.darkMode) {
                          editor.contentDocument.documentElement.classList.add('dark-mode');
          Severity: Minor
          Found in resources/js/wysiwyg/config.js - About 1 hr to fix

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

                return function setupCallback(editor) {
                    function editorChange() {
                        if (options.darkMode) {
                            editor.contentDocument.documentElement.classList.add('dark-mode');
                        }
            Severity: Minor
            Found in resources/js/wysiwyg/config.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status