IHTSDO/component-identifier-service

View on GitHub

Showing 1,102 of 1,102 total issues

Avoid deeply nested control flow statements.
Open

                                if (!data) {
                                    callback("Scheme not found for key:" + JSON.stringify(key));
                                    return;
                                }
Severity: Major
Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if (err) {
                                        error = true;
                                        callback(err);
                                        return;
                                    }
    Severity: Major
    Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (err) {
                                  console.log("Error-3 in back end service:" + JSON.stringify(err));
                                  return;
                              } else {
                                  console.log("End job " + record.name + " - id:" + record.id);
      Severity: Major
      Found in blogic/BackEndJobService.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for (i = 0; i < records.length; i++) {
                                    if (records[i][1] == code) {
                                        break;
                                    }
                                }
        Severity: Major
        Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                  if (err) {
                                                      callback(err);
                                                  } else {
                                                      callback(null);
                                                  }
          Severity: Major
          Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (err) {
                                        console.log("Error-3 in back end service:" + JSON.stringify(err));
                                        return;
                                    } else {
                                        console.log("End job " + record.name + " - id:" + record.id);
            Severity: Major
            Found in blogic/BackEndJobService.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (i > -1 && i < records.length) {
                                          console.log("pos i:" + i);
                                          var data = getScheme.sync(null, key);
                                          if (!data) {
                                              callback("Scheme not found for key:" + JSON.stringify(key));
              Severity: Major
              Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (ret){
                                                    throw ret;
                                                }
                Severity: Major
                Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (err) {
                                          lightJob.status = "3";
                                          if (typeof err == "object") {
                                              lightJob.log = JSON.stringify(err);
                                          } else {
                  Severity: Major
                  Found in blogic/BackEndJobService.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                            } else if (request.type == job.JOBTYPE.deprecateSctids) {
                                request.action = stateMachine.actions.deprecate;
                                idDM.updateSctids(request, function (err) {
                    
                                    if (err) {
                    Severity: Major
                    Found in blogic/BackEndJobService.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if (diff) {
                                                          sysIdToCreate = diff;
                                                      }
                      Severity: Major
                      Found in blogic/SchemeIdBulkDataManager.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (typeof err == "object") {
                                                    lightJob.log = JSON.stringify(err);
                                                } else {
                                                    lightJob.log = err;
                                                }
                        Severity: Major
                        Found in blogic/BackEndJobService.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (err) {
                                                  lightJob.status = "3";
                                                  if (typeof err == "object") {
                                                      lightJob.log = JSON.stringify(err);
                                                  } else {
                          Severity: Major
                          Found in blogic/BackEndJobService.js - About 45 mins to fix

                            Function editNamespace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports.editNamespace = function editNamespace(id, editedNamespace, callback) {
                                dbInit.getDB(function (err, pdb, model) {
                                    if (err)
                                        throw err;
                                    else{
                            Severity: Minor
                            Found in blogic/NamespaceDataManager.js - About 45 mins 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 conceptIdBulkCreation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            var conceptIdBulkCreation = function (namespace, partitionId, idsTotal, request, callback) {
                            Severity: Minor
                            Found in blogic/BulkIdCreation.js - About 35 mins to fix

                              Function testQuantity has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              var testQuantity = function (auxTable, namespace, partitionId, idsTotal, callback) {
                              Severity: Minor
                              Found in blogic/BulkIdCreation.js - About 35 mins to fix

                                Function createIds has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                var createIds = function (auxTable, namespace, partitionId, idsTotal, callback) {
                                Severity: Minor
                                Found in blogic/BulkIdCreation.js - About 35 mins to fix

                                  Function idBulkCreation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  var idBulkCreation = function (auxTable, namespace, partitionId, idsTotal, callback){
                                  Severity: Minor
                                  Found in blogic/IdReposition.js - About 35 mins to fix

                                    Function getSchemeId has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    var getSchemeId=function (scheme, schemeId, systemId, autoSysId, callback) {
                                    Severity: Minor
                                    Found in blogic/SchemeIdBulkDataManager.js - About 35 mins to fix

                                      Function relationshipIdBulkCreation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      var relationshipIdBulkCreation = function (namespace, partitionId, idsTotal, request, callback) {
                                      Severity: Minor
                                      Found in blogic/BulkIdCreation.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language