Showing 1,102 of 1,102 total issues
Avoid deeply nested control flow statements. Open
Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Avoid deeply nested control flow statements. Open
Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Avoid deeply nested control flow statements. Open
Open
if (err) {
return next(err.message);
}
Avoid deeply nested control flow statements. Open
Open
if (ret){
throw ret;
}
Function getSchemeId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
var getSchemeId=function (scheme, schemeId, systemId, autoSysId, callback) {
Sync(function () {
if (!schemes[scheme.toUpperCase()].validSchemeId(schemeId)){
callback("Not valid SchemeId: " + schemeId, 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"
Further reading
Avoid deeply nested control flow statements. Open
Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Function findFieldSelect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
job.findFieldSelect=function(query, fields,limit, skip,orderBy, callback){
Avoid deeply nested control flow statements. Open
Open
if (err) {
var str = "[ERROR] " + (new Date()).getTime() + ": namespace=" + namespace + ", partition=" + partitionId + ". " + err;
console.log(str);
}
Avoid deeply nested control flow statements. Open
Open
if (diff) {
sysIdToCreate = diff;
}
Avoid deeply nested control flow statements. Open
Open
if (sctIdRecord != null) {
sctIdRecord.jobId = operation.jobId;
sctid.save.sync(null,sctIdRecord);
canContinue = false;
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Avoid deeply nested control flow statements. Open
Open
if (err) {
return next(err.message);
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Avoid deeply nested control flow statements. Open
Open
if (res) {
var syscode = res[0];
var i = -1;
for (i = 0; i < records.length; i++) {
if (records[i][5] == syscode) {
Avoid deeply nested control flow statements. Open
Open
if (!thisPartition) {
callback("Partition not found for key:" + JSON.stringify(key));
return;
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
error = true;
callback(err);
return;
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
callback(err);
} else {
callback(null);
}
Avoid deeply nested control flow statements. Open
Open
if (cont == records.length) {
callback(null);
return;
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
return next(err.message);
}
Avoid deeply nested control flow statements. Open
Open
if (err) {
return next(err.message);
}