markdown-note/markdown-notes

View on GitHub

Showing 48 of 144 total issues

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

  function _initDisplay() {
    var openNotebooks = _notebooks.getLastOpenedNotebooks();
    if (openNotebooks) {
      // Show the last open notebooks.
      _async.each(openNotebooks, function(notebookID, cbMain) {
Severity: Minor
Found in src/browser/notebooks/notebook-client.js - About 1 hr to fix

    Function getAllActiveNotes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getAllActiveNotes(notebookID, cbMain) {
        var notesDb = _app.getNotesDb();
        var dtNow = new Date();
        notesDb.find({
          $where: function() {
    Severity: Minor
    Found in src/browser/notes/note.js - About 1 hr to fix

      Function deleteNote has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function deleteNote(note) {
          try {
            var respConfirm = window.confirm(_i18n.__('note.deletion_confirmation_text'),
              _i18n.__('note.deletion_confirmation_title'));
            if (!respConfirm) {
      Severity: Minor
      Found in src/browser/notes/note-client.js - About 1 hr to fix

        Function getCompletedNotesForDate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function getCompletedNotesForDate(notebookID, date, cbMain) {
            var notesDb = _app.getNotesDb();
            var dtSelectedDate = date;
            notesDb.find({
              $where: function() {
        Severity: Minor
        Found in src/browser/notes/note.js - About 1 hr to fix

          Function AppError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          var AppError = function(err, customMsg, log, overrideMsg) {
            if (!err) {
              throw new ReferenceError('Invalid error object.');
            }
          
          
          Severity: Minor
          Found in src/common/app-error.js - About 55 mins 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 Notebooks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          var Notebooks = function() {
            const OPEN_NOTEBOOKS = 'open-notebooks';
            const CURRENT_OPEN_NOTEBOOK = 'current-notebook';
          
            /**
          Severity: Minor
          Found in src/browser/notebooks/notebook.js - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                      if (foundStartNode) {
                        chunk.sameNodes = true;
                      } else {
                        chunk.sameNodes = false;
                      }
          Severity: Major
          Found in src/browser/notes/note-editor.js - About 45 mins to fix

            Function SettingEvents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            var SettingEvents = function() {
              var settingsClient;
              var dlg = null;
              var allTabs = null;
              var allTabAnchors = null;
            Severity: Minor
            Found in src/browser/settings/setting-events.js - About 45 mins 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