Laverna/laverna

View on GitHub
app/scripts/modules/codemirror/controller.js

Summary

Maintainability
C
1 day
Test Coverage

File controller.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright (C) 2015 Laverna project Authors.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Severity: Minor
Found in app/scripts/modules/codemirror/controller.js - About 5 hrs to fix

    Function initEditor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            initEditor: function() {
                this.editor = CodeMirror.fromTextArea(document.getElementById('editor--input'), {
                    mode          : {
                        name        : 'gfm',
                        gitHubSpice : false
    Severity: Minor
    Found in app/scripts/modules/codemirror/controller.js - About 1 hr to fix

      Function onScroll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              onScroll: _.debounce(function(e) {
      
                  // Don't do any computations
                  if (!e.doc.scrollTop) {
                      this.view.ui.previewScroll.scrollTop(0);
      Severity: Minor
      Found in app/scripts/modules/codemirror/controller.js - About 1 hr to fix

        Function toggleBlock has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                toggleBlock: function(type) {
                    var stat  = this.getState(),
                        start = this.editor.getCursor('start'),
                        end   = this.editor.getCursor('end'),
                        text,
        Severity: Minor
        Found in app/scripts/modules/codemirror/controller.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status