Showing 213 of 1,102 total issues
File sctid.js
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by ar on 11/24/15.
*/
var db=require("../config/MysqlInit");
Function generateSctids
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var generateSctids=function (operation, callback) {
getModel(function (err) {
if (err) {
console.log("error model:" + err);
callback(err);
Function generateSctids
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.generateSctids = function generateSctids (req, res, next) {
var token = req.swagger.params.token.value;
var generationData = req.swagger.params.generationData.value;
security.authenticate(token, function(err, data) {
Function insertRecords
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var insertRecords=function(records, operation, callback) {
Sync(function () {
var err;
try {
sctid.bulkInsert.sync(null, records);
Function generateSchemeIds
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var generateSchemeIds=function ( operation, callback) {
getModel(function (err) {
if (err) {
console.log("error model:" + err);
callback(err);
Function registerSctids
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var registerSctids=function (operation, callback) {
getModel(function (err) {
if (err) {
console.log("error model:" + err);
callback(err);
Function generateSctid
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.generateSctid = function generateSctid (req, res, next) {
var token = req.swagger.params.token.value;
var generationData = req.swagger.params.generationData.value;
security.authenticate(token, function(err, data) {
if (err) {
Function findFieldSelect
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
job.findFieldSelect=function(query, fields,limit, skip,orderBy, callback){
db.getDB(function (err,connection)
{
if (err) throw err;
if (!query){
Function cleanUpExpiredIds
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var cleanUpExpiredIds = function (callback){
strErr="";
strData="";
strMsg="";
var arrMsg=[];
Function idBulkCreation
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var idBulkCreation = function (auxTable, namespace, partitionId, idsTotal, callback){
//var t1=new Date().getTime();
var query={namespace:namespace};
auxTable.availableCount(query,function(err,recs){
Consider simplifying this complex logical expression. Open
Open
if (partitionId != "00"
&& partitionId != "01"
&& partitionId != "02"
&& partitionId != "10"
&& partitionId != "11"
File SchemeId.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by ar on 7/16/15.
*/
'use strict';
Function registerSchemeIds
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var registerSchemeIds=function ( operation, callback) {
Sync(function () {
try {
var cont = 0;
var records = [];
File Namespace.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by alo on 7/13/15.
*/
'use strict';
File schemeid.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by ar on 11/24/15.
*/
var db=require("../config/MysqlInit");
Function registerSctidsSmallRequest
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var registerSctidsSmallRequest=function (operation, callback) {
Sync(function () {
try {
var cont = 0;
Function generateSchemeId
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
var generateSchemeId=function (scheme, operation, callback) {
if (!operation.autoSysId) {
getSchemeIdBySystemId(scheme, operation.systemId, function (err, schemeId) {
if (err) {
callback(err, 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 generateSctid
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
var generateSctid=function (operation, callback) {
if (!operation.autoSysId) {
getSctidBySystemId(operation.namespace, operation.systemId, function (err, sctid) {
if (err) {
callback(err, 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 generateSctidsSmallRequest
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var generateSctidsSmallRequest=function (operation, callback) {
console.log ("Unexpected call to generateSctidsSmallRequest");
getModel(function (err) {
if (err) {
console.log("error model:" + err);
File BulkIdCreation.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by ar on 3/8/17.
*/