markdown-note/markdown-notes

View on GitHub

Showing 48 of 144 total issues

Function NoteEditor has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
Open

var NoteEditor = function() {
  const NOTE_COMPLETE_CLASS = 'complete';
  const DEFAULT_NOTE_CLASS = 'note';
  const NOTE_NOT_EDITABLE_CLASS = 'readonly';
  const NOTE_TO_BE_MOVED = 'modified';
Severity: Minor
Found in src/browser/notes/note-editor.js - About 2 days 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 NoteEditor has 285 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var NoteEditor = function() {
  const NOTE_COMPLETE_CLASS = 'complete';
  const DEFAULT_NOTE_CLASS = 'note';
  const NOTE_NOT_EDITABLE_CLASS = 'readonly';
  const NOTE_TO_BE_MOVED = 'modified';
Severity: Major
Found in src/browser/notes/note-editor.js - About 1 day to fix

    Function NoteClient has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
    Open

    var NoteClient = function() {
      var currentlyFocusedNote = null;
    
      function _init() {
        // Initialize note events with callback events.
    Severity: Minor
    Found in src/browser/notes/note-client.js - About 1 day 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 NoteClient has 269 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var NoteClient = function() {
      var currentlyFocusedNote = null;
    
      function _init() {
        // Initialize note events with callback events.
    Severity: Major
    Found in src/browser/notes/note-client.js - About 1 day to fix

      Function Notes has 264 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Notes = function() {
        /**
         * Fetches the notes present in the given notebook.
         * @param  {String} notebookID Notebook ID
         * @param  {function} cbMain   Callback method that is sent an errror object
      Severity: Major
      Found in src/browser/notes/note.js - About 1 day to fix

        Function Notes has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
        Open

        var Notes = function() {
          /**
           * Fetches the notes present in the given notebook.
           * @param  {String} notebookID Notebook ID
           * @param  {function} cbMain   Callback method that is sent an errror object
        Severity: Minor
        Found in src/browser/notes/note.js - About 1 day 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 NotebooksClient has 257 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var NotebooksClient = function() {
          var notebooksContainerUL, notebooksTabHeading, notebooksTabContainer;
          const EMPTY_NOTES_CLASS = 'empty-notebook';
        
          function _init(cbMain) {
        Severity: Major
        Found in src/browser/notebooks/notebook-client.js - About 1 day to fix

          Function NoteEvents has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
          Open

          var NoteEvents = function() {
            var _noteHandler = {};
            var _eventProperties = ['isEditable', 'isComplete', 'isReadOnly'];
          
            function init(noteCallbackMethods) {
          Severity: Minor
          Found in src/browser/notes/note-events.js - About 1 day 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 NoteEvents has 174 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var NoteEvents = function() {
            var _noteHandler = {};
            var _eventProperties = ['isEditable', 'isComplete', 'isReadOnly'];
          
            function init(noteCallbackMethods) {
          Severity: Major
          Found in src/browser/notes/note-events.js - About 6 hrs to fix

            Function Settings has 162 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Settings = function() {
              var appSettings = null;
            
              var loadSettings = function() {
                try {
            Severity: Major
            Found in src/common/settings.js - About 6 hrs to fix

              Function NotebookEvents has 149 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var NotebookEvents = function() {
                var containerUL = null;
                var tabHeading = null;
                var tabContainer = null;
                var client = null;
              Severity: Major
              Found in src/browser/notebooks/notebook-events.js - About 5 hrs to fix

                Function Notebooks has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var Notebooks = function() {
                  const OPEN_NOTEBOOKS = 'open-notebooks';
                  const CURRENT_OPEN_NOTEBOOK = 'current-notebook';
                
                  /**
                Severity: Major
                Found in src/browser/notebooks/notebook.js - About 5 hrs to fix

                  Function NotebooksClient has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var NotebooksClient = function() {
                    var notebooksContainerUL, notebooksTabHeading, notebooksTabContainer;
                    const EMPTY_NOTES_CLASS = 'empty-notebook';
                  
                    function _init(cbMain) {
                  Severity: Minor
                  Found in src/browser/notebooks/notebook-client.js - About 5 hrs 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 Utility has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var Utility = function() {
                    var loadPartial = function(partialName, data, callback) {
                      loadTemplateFile(partialName, false, data, callback);
                    };
                  
                  
                  Severity: Major
                  Found in src/common/utility.js - About 4 hrs to fix

                    Function Utility has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var Utility = function() {
                      var loadPartial = function(partialName, data, callback) {
                        loadTemplateFile(partialName, false, data, callback);
                      };
                    
                    
                    Severity: Minor
                    Found in src/common/utility.js - About 4 hrs 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 NotebookEvents has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var NotebookEvents = function() {
                      var containerUL = null;
                      var tabHeading = null;
                      var tabContainer = null;
                      var client = null;
                    Severity: Minor
                    Found in src/browser/notebooks/notebook-events.js - About 4 hrs 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 Settings has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var Settings = function() {
                      var appSettings = null;
                    
                      var loadSettings = function() {
                        try {
                    Severity: Minor
                    Found in src/common/settings.js - About 4 hrs 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 SettingEvents has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var SettingEvents = function() {
                      var settingsClient;
                      var dlg = null;
                      var allTabs = null;
                      var allTabAnchors = null;
                    Severity: Major
                    Found in src/browser/settings/setting-events.js - About 3 hrs to fix

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

                      /*****************************************************************
                       * Contains code to determine and change the current state
                       * of the note. For example to determine when the note is
                       * currently editable, complete and to make it editable.
                       * Only deals with the DOM side of things.
                      Severity: Minor
                      Found in src/browser/notes/note-editor.js - About 3 hrs to fix

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

                        /*****************************************************************
                         * Acts like a controller and contains code to handle notes in the
                         * application. It calls and coordinates the activities of other
                         * note-related modules such as the notes, note editor and events.
                         *
                        Severity: Minor
                        Found in src/browser/notes/note-client.js - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language