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) {
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() {
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) {
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() {
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.');
}
- 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 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';
/**
- 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
Avoid deeply nested control flow statements. Open
if (foundStartNode) {
chunk.sameNodes = true;
} else {
chunk.sameNodes = false;
}
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;
- 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"