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';
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');
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
*************************************************/
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';
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;
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;
Function App
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var App = function() {
var dbObjs = {};
/**
* Called when the application starts.
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);
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() {
- Read upRead up
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() {
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();
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';
- Read upRead up
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) {
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;
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.'),
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')));
}
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;
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(),
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;
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';
- Read upRead up
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"