Showing 213 of 1,102 total issues
Function save
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
sctid.save=function(sctIdRecord,callback){
db.getDB(function (err,connection)
{
if (err) throw err;
Function save
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
job.save=function(jobRecord,callback){
db.getDB(function (err,connection)
{
if (err) throw err;
Function save
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
schemeid.save=function(schemeIdRecord,callback){
db.getDB(function (err,connection)
{
if (err) throw err;
Function registerSchemeIds
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.registerSchemeIds = function registerSchemeIds (req, res, next) {
var token = req.swagger.params.token.value;
var schemeName = req.swagger.params.schemeName.value;
var registrationMetadata = req.swagger.params.registrationMetadata.value;
security.authenticate(token, function(err, data) {
Function publishSchemeIds
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.publishSchemeIds = function publishSchemeIds (req, res, next) {
var token = req.swagger.params.token.value;
var schemeName = req.swagger.params.schemeName.value;
var publicationMetadata = req.swagger.params.publicationMetadata.value;
security.authenticate(token, function(err, data) {
Function reserveSchemeIds
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.reserveSchemeIds = function reserveSchemeIds (req, res, next) {
var token = req.swagger.params.token.value;
var schemeName = req.swagger.params.schemeName.value;
var reservationMetadata = req.swagger.params.reservationMetadata.value;
security.authenticate(token, function(err, data) {
Function createNamespace
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.createNamespace = function createNamespace (req, res, next) {
var token = req.swagger.params.token.value;
var namespaceData = req.swagger.params.namespace.value;
security.authenticate(token, function(err, data) {
if (err)
Function releaseSchemeIds
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.releaseSchemeIds = function releaseSchemeIds (req, res, next) {
var token = req.swagger.params.token.value;
var schemeName = req.swagger.params.schemeName.value;
var releaseMetadata = req.swagger.params.releaseMetadata.value;
security.authenticate(token, function(err, data) {
Function deprecateSchemeIds
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.deprecateSchemeIds = function deprecateSchemeIds (req, res, next) {
var token = req.swagger.params.token.value;
var schemeName = req.swagger.params.schemeName.value;
var deprecationMetadata = req.swagger.params.deprecationMetadata.value;
security.authenticate(token, function(err, data) {
Function getNamespace
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var getNamespace=function(sctid){
if (sctid){
if (!validSCTId(sctid)){
return 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
Function getSequence
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var getSequence=function(sctid){
if (sctid){
if (!validSCTId(sctid)){
return 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
Function authenticate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports.authenticate = function authenticate (token, callback) {
if (authenticationCache[token]) {
var now = Date.now();
var ago = (Date.now() - authenticationCache[token].timestamp);
if (ago < (60000*60)) {
- 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 count
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
sctid.count=function(query,callback){
db.getDB(function (err,connection)
{
if (err) throw err;
- 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 (diff) {
sctIdToRegister = diff;
}
Avoid deeply nested control flow statements. Open
for (i = 0; i < records.length; i++) {
if (records[i][0] == code) {
break;
}
}
Avoid deeply nested control flow statements. Open
if (limit && limit > 0 && limit < cont) {
break;
}
Avoid deeply nested control flow statements. Open
if (err) {
console.log("Error accessing groups", err);
callback(able);
} else {
result.forEach(function(loopGroup){
Function updateJobId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
schemeid.updateJobId=function(existingSystemId, scheme, jobId, callback){
db.getDB(function (err,connection)
{
if (err) {
- 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 (limit && limit > 0 && limit < cont) {
break;
}
Avoid deeply nested control flow statements. Open
if (limit && limit > 0 && limit < cont) {
break;
}