IHTSDO/component-identifier-service

View on GitHub

Showing 213 of 1,102 total issues

File sctid.js has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Created by ar on 11/24/15.
 */
var db=require("../config/MysqlInit");

Severity: Minor
Found in model/sctid.js - About 4 hrs to fix

    Function generateSctids has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var generateSctids=function (operation, callback) {
        getModel(function (err) {
            if (err) {
                console.log("error model:" + err);
                callback(err);
    Severity: Major
    Found in blogic/SCTIdBulkDataManager.js - About 3 hrs to fix

      Function generateSctids has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      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) {
      Severity: Major
      Found in controllers/SctidBulk.js - About 3 hrs to fix

        Function insertRecords has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var insertRecords=function(records, operation, callback) {
            Sync(function () {
                var err;
                try {
                    sctid.bulkInsert.sync(null, records);
        Severity: Major
        Found in blogic/SCTIdBulkDataManager.js - About 3 hrs to fix

          Function generateSchemeIds has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var generateSchemeIds=function ( operation, callback) {
              getModel(function (err) {
                  if (err) {
                      console.log("error model:" + err);
                      callback(err);
          Severity: Major
          Found in blogic/SchemeIdBulkDataManager.js - About 3 hrs to fix

            Function registerSctids has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var registerSctids=function (operation, callback) {
                getModel(function (err) {
                    if (err) {
                        console.log("error model:" + err);
                        callback(err);
            Severity: Major
            Found in blogic/SCTIdBulkDataManager.js - About 3 hrs to fix

              Function generateSctid has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              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) {
              Severity: Major
              Found in controllers/Sctid.js - About 3 hrs to fix

                Function findFieldSelect has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                job.findFieldSelect=function(query, fields,limit, skip,orderBy, callback){
                    db.getDB(function (err,connection)
                    {
                        if (err) throw err;
                        if (!query){
                Severity: Major
                Found in model/job.js - About 3 hrs to fix

                  Function cleanUpExpiredIds has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var cleanUpExpiredIds = function (callback){
                      strErr="";
                      strData="";
                      strMsg="";
                      var arrMsg=[];
                  Severity: Major
                  Found in blogic/CleanService.js - About 3 hrs to fix

                    Function idBulkCreation has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var idBulkCreation = function (auxTable, namespace, partitionId, idsTotal, callback){
                    
                        //var t1=new Date().getTime();
                        var query={namespace:namespace};
                        auxTable.availableCount(query,function(err,recs){
                    Severity: Major
                    Found in blogic/IdReposition.js - About 2 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if (partitionId != "00"
                                      && partitionId != "01"
                                      && partitionId != "02"
                                      && partitionId != "10"
                                      && partitionId != "11"
                      Severity: Critical
                      Found in blogic/SCTIdDataManager.js - About 2 hrs to fix

                        File SchemeId.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Created by ar on 7/16/15.
                         */
                        'use strict';
                        
                        
                        Severity: Minor
                        Found in controllers/SchemeId.js - About 2 hrs to fix

                          Function registerSchemeIds has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var registerSchemeIds=function ( operation, callback) {
                              Sync(function () {
                                  try {
                                      var cont = 0;
                                      var records = [];
                          Severity: Major
                          Found in blogic/SchemeIdBulkDataManager.js - About 2 hrs to fix

                            File Namespace.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /**
                             * Created by alo on 7/13/15.
                             */
                            'use strict';
                            
                            
                            Severity: Minor
                            Found in controllers/Namespace.js - About 2 hrs to fix

                              File schemeid.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * Created by ar on 11/24/15.
                               */
                              var db=require("../config/MysqlInit");
                              
                              
                              Severity: Minor
                              Found in model/schemeid.js - About 2 hrs to fix

                                Function registerSctidsSmallRequest has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                var registerSctidsSmallRequest=function (operation, callback) {
                                
                                    Sync(function () {
                                        try {
                                            var cont = 0;
                                Severity: Major
                                Found in blogic/SCTIdBulkDataManager.js - About 2 hrs to fix

                                  Function generateSchemeId has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  var generateSchemeId=function (scheme, operation, callback) {
                                      if (!operation.autoSysId) {
                                          getSchemeIdBySystemId(scheme, operation.systemId, function (err, schemeId) {
                                              if (err) {
                                                  callback(err, null);
                                  Severity: Minor
                                  Found in blogic/SchemeIdDataManager.js - About 2 hrs to fix

                                  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

                                  var generateSctid=function (operation, callback) {
                                      if (!operation.autoSysId) {
                                          getSctidBySystemId(operation.namespace, operation.systemId, function (err, sctid) {
                                              if (err) {
                                                  callback(err, null);
                                  Severity: Minor
                                  Found in blogic/SCTIdDataManager.js - About 2 hrs to fix

                                  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

                                  var generateSctidsSmallRequest=function (operation, callback) {
                                      console.log ("Unexpected call to generateSctidsSmallRequest");
                                      getModel(function (err) {
                                          if (err) {
                                              console.log("error model:" + err);
                                  Severity: Major
                                  Found in blogic/SCTIdBulkDataManager.js - About 2 hrs to fix

                                    File BulkIdCreation.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    /**
                                     * Created by ar on 3/8/17.
                                     */
                                    
                                    
                                    
                                    Severity: Minor
                                    Found in blogic/BulkIdCreation.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language