Showing 213 of 1,102 total issues
Function find
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
schemeid.find=function(query, limit, skip, callback){
db.getDB(function (err,connection)
{
if (err) throw err;
var swhere="";
- 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 save
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
job.save=function(jobRecord,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
Function find
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
sctid.find=function(query, limit, skip, callback){
db.getDB(function (err,connection)
{
if (err) throw err;
var swhere="";
- 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 insertSchemeIdRecord
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function insertSchemeIdRecord(newSchemeIdRecord, autoSysId, callback){
Sync(function() {
var err;
var newSchemeIdRecord2;
try {
Function isAbleUser
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isAbleUser(namespaceId, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function isAbleUser
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isAbleUser(namespaceId, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function isSchemeAbleUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isSchemeAbleUser(schemeName, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function isAbleUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isAbleUser(schemeName, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function isSchemeAbleUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isSchemeAbleUser(schemeName, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function isAbleUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isAbleUser(schemeName, user, callback){
var able = false;
security.admins.forEach(function(admin){
if (admin == user)
able = true;
Function getSctids
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getSctids=function (sctidArray, callback) {
sctidArray.forEach(function (sctId) {
if (!sctIdHelper.validSCTId(sctId)) {
Function registerSchemeId
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var registerSchemeId=function (scheme, operation, callback){
if (!operation.autoSysId) {
getSchemeIdBySystemId(scheme, operation.systemId, function (err, schemeId) {
if (err) {
Function registerSctid
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var registerSctid=function (operation, callback) {
if (!operation.autoSysId) {
getSctidBySystemId(operation.namespace, operation.systemId, function (err, sctid) {
if (err) {
Method callCis
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private List<Long> callCis(String operation, CISBulkRequest request, boolean includeSchemeName) throws CISClientException {
String bulkJobId;
String jobInfo = operation;
try {
CISBulkRequestResponse responseBody;
Function runner
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var runner = function (){
namespaceDm.getNamespaces(function(err, namespaces) {
if (err) {
console.log("[ERROR] " + (new Date()).getTime() + ": namespace=" + namespace + ", partition=" + partitionId + ". " + err);
return;
Function getJobRecords
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getJobRecords(jobId, callback) {
bulkJob.findById({id: parseInt(jobId)}, function (err, jobRecord) {
if (err) {
callback(err, null);
Function getNamespacesForUser
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.getNamespacesForUser = function getNamespacesForUser (req, res, next) {
var token = req.swagger.params.token.value;
var username = req.swagger.params.username.value;
security.authenticate(token, function(err, data) {
if (err)
Function publishSctids
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.publishSctids = function publishSctids (req, res, next) {
var token = req.swagger.params.token.value;
var publicationData = req.swagger.params.publicationData.value;
security.authenticate(token, function(err, data) {
if (err) {
Function registerSctids
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.registerSctids = function registerSctids (req, res, next) {
var token = req.swagger.params.token.value;
var registrationData = req.swagger.params.registrationData.value;
security.authenticate(token, function(err, data) {
if (err) {
Function releaseSctids
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.releaseSctids = function releaseSctids (req, res, next) {
var token = req.swagger.params.token.value;
var releaseData = req.swagger.params.releaseData.value;
security.authenticate(token, function(err, data) {
if (err) {