markdown-note/markdown-notes

View on GitHub

Showing 48 of 144 total issues

Function NotebookUtils has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var NotebookUtils = function() {
  function getNotebookItem(notebook, isChecked) {
    var checkedHTML = '';
    if (isChecked) {
      checkedHTML = 'checked';
Severity: Major
Found in src/browser/notebooks/notebook-utils.js - About 2 hrs to fix

    File notebook-client.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* jshint esnext: true */
    'use strict';
    
    var _i18n = require('i18n');
    var _async = require('async');
    Severity: Minor
    Found in src/browser/notebooks/notebook-client.js - About 2 hrs to fix

      File note.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*************************************************
       * Contains code to communicate with the Notes
       * database.
       * @author : Abijeet Patro
       *************************************************/
      Severity: Minor
      Found in src/browser/notes/note.js - About 2 hrs to fix

        Function SettingsClient has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var SettingsClient = function() {
          var dlg = null;
          var allTabs = null;
          var allTabAnchors = null;
          var defaultMsgClass = 'alert';
        Severity: Major
        Found in src/browser/settings/setting-client.js - About 2 hrs to fix

          Function handleTextModifier has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function handleTextModifier(note, modifierType) {
              var sel = window.getSelection();
              if (sel.rangeCount) {
                var range = sel.getRangeAt(0);
                var noteStr = note.innerText;
          Severity: Major
          Found in src/browser/notes/note-editor.js - About 2 hrs to fix

            Function MarkdownNotes has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var MarkdownNotes = function() {
              // Keep a track of whether the settings have changed.
              // Some settings need to be applied at application
              // close.
              var settingsToBeApplied = null;
            Severity: Major
            Found in src/renderer/markdown-notes.js - About 2 hrs to fix

              Function App has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var App = function() {
                var dbObjs = {};
              
                /**
                 * Called when the application starts.
              Severity: Minor
              Found in src/browser/app/app.js - About 1 hr to fix

                Function AppEvents has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var AppEvents = function() {
                
                  function init() {
                    document.getElementById('1_btnShortcutHelp').addEventListener('click', showShortcutDialog, false);
                    document.getElementById('1_btnAboutUs').addEventListener('click', showAboutDialog, false);
                Severity: Minor
                Found in src/browser/app/app-events.js - About 1 hr to fix

                  Function MainWindow has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var MainWindow = function() {
                    var mainWindow = null;
                    var isMaximized = false;
                  
                    function init() {
                  Severity: Minor
                  Found in src/renderer/main-window.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function MainWindow has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var MainWindow = function() {
                    var mainWindow = null;
                    var isMaximized = false;
                  
                    function init() {
                  Severity: Minor
                  Found in src/renderer/main-window.js - About 1 hr to fix

                    Function showTab has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function showTab(notebookID, updateActiveNotebook, cbMain) {
                        // Fetch the notebook details
                        _notebooks.getFullDetailByID(notebookID, function(err, notebookData) {
                          if (err) {
                            err.display();
                    Severity: Minor
                    Found in src/browser/notebooks/notebook-client.js - About 1 hr to fix

                      Function NotebookUtils has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var NotebookUtils = function() {
                        function getNotebookItem(notebook, isChecked) {
                          var checkedHTML = '';
                          if (isChecked) {
                            checkedHTML = 'checked';
                      Severity: Minor
                      Found in src/browser/notebooks/notebook-utils.js - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                        var updateSettings = function(newSettings, cbMain) {
                          var oldSettings = getAppSettings();
                          var requiresRestart = false;
                          var newSettingsToApply = {};
                          if (newSettings.dbLocation !== oldSettings.dbLocation) {
                      Severity: Minor
                      Found in src/common/settings.js - About 1 hr to fix

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

                          var init = function(cbMain) {
                            // Generate the db storage locations based on settings.
                            var settings = _settings.getAppSettings();
                            var dbBasePath = settings.dbLocation;
                        
                        
                        Severity: Minor
                        Found in src/browser/app/app.js - About 1 hr to fix

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

                            function changeNoteDate(noteID, updatedDate, isComplete, cbMain) {
                              var notesDb = _app.getNotesDb();
                              var err = null;
                              if (!noteID) {
                                err = new _appError(new Error('Please provide the note ID.'),
                          Severity: Minor
                          Found in src/browser/notes/note.js - About 1 hr to fix

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

                              function _modifyNote(noteObj, isNewNote, cbMain) {
                                if (!_validateNote(noteObj, isNewNote)) {
                                  return cbMain(new _appError(new Error('Invalid note object'),
                                    _i18n.__('error.notes_save_validation_err')));
                                }
                            Severity: Minor
                            Found in src/browser/notes/note.js - About 1 hr to fix

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

                                function evtNotebookDateChanged(e) {
                                  var selectedDate = null;
                                  var currentDateInt = null;
                                  var selectedDateInt = null;
                                  var notebookDbID = null;
                              Severity: Minor
                              Found in src/browser/notebooks/notebook-events.js - About 1 hr to fix

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

                                  function loadTemplateFile(fileName, isDialog, data, callback) {
                                    try {
                                      if (typeof data === 'undefined' || !data) {
                                        data = {
                                          AppUtil: new Utility(),
                                Severity: Minor
                                Found in src/common/utility.js - About 1 hr to fix

                                  Function saveNote has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function saveNote(note, isBlur, isNoteComplete) {
                                      var noteText = note.innerText;
                                      if (noteText) {
                                        try {
                                          var noteID = note.dataset.noteid;
                                  Severity: Minor
                                  Found in src/browser/notes/note-client.js - About 1 hr to fix

                                    Function SettingsClient has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    var SettingsClient = function() {
                                      var dlg = null;
                                      var allTabs = null;
                                      var allTabAnchors = null;
                                      var defaultMsgClass = 'alert';
                                    Severity: Minor
                                    Found in src/browser/settings/setting-client.js - About 1 hr to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language