IHTSDO/component-identifier-service

View on GitHub

Showing 1,102 of 1,102 total issues

Function setNewSchemeIdRecord has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setNewSchemeIdRecord(operation, thisScheme, callback) {
    Sync(function () {
        try {

            var previousCode=thisScheme.idBase;
Severity: Minor
Found in blogic/SchemeIdBulkDataManager.js - About 1 hr to fix

    Function setNewSCTIdRecord has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function setNewSCTIdRecord(operation,thisPartition,callback) {
        Sync(function () {
            try {
                //The transaction around the partition sequence number increment 
                //(and subsequent save to database) is covered
    Severity: Minor
    Found in blogic/SCTIdBulkDataManager.js - About 1 hr to fix

      Function count has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      sctid.count=function(query,callback){
      
          db.getDB(function (err,connection)
          {
              if (err) throw err;
      Severity: Minor
      Found in model/sctid.js - About 1 hr to fix

        Function setAvailableSchemeIdRecord2NewStatus has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function setAvailableSchemeIdRecord2NewStatus(operation, thisScheme, callback){
            Sync(function () {
                try {
                    var query = {scheme: thisScheme.scheme.toUpperCase(), status: stateMachine.statuses.available};
        
        
        Severity: Minor
        Found in blogic/SchemeIdBulkDataManager.js - About 1 hr to fix

          Function setAvailableSchemeIdRecord2NewStatus has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function setAvailableSchemeIdRecord2NewStatus(scheme, operation, action, callback){
              var query={scheme:scheme, status: stateMachine.statuses.available };
          
              schemeid.find(query ,1 ,null, function(err, schemeIdRecords){
                  if (err) {
          Severity: Minor
          Found in blogic/SchemeIdDataManager.js - About 1 hr to fix

            Function setAvailableSCTIDRecord2NewStatus has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function setAvailableSCTIDRecord2NewStatus(operation, action, callback){
                var query={namespace: parseInt(operation.namespace), partitionId:operation.partitionId, status: stateMachine.statuses.available };
                sctid.find(query ,1, null,function(err, sctIdRecords){
                    if (err) {
                        callback(err, null);
            Severity: Minor
            Found in blogic/SCTIdDataManager.js - About 1 hr to fix

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

              module.exports.generateSchemeIds = function generateSchemeIds (req, res, next) {
                  var token = req.swagger.params.token.value;
                  var schemeName = req.swagger.params.schemeName.value;
                  var generationMetadata = req.swagger.params.generationMetadata.value;
                  security.authenticate(token, function(err, data) {
              Severity: Minor
              Found in controllers/SchemeIdBulk.js - About 1 hr to fix

                Function reserveSctids has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports.reserveSctids = function reserveSctids (req, res, next) {
                    var token = req.swagger.params.token.value;
                    var reservationData = req.swagger.params.reservationData.value;
                    security.authenticate(token, function(err, data) {
                        if (err) {
                Severity: Minor
                Found in controllers/SctidBulk.js - About 1 hr to fix

                  Function getNextNumber has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getNextNumber( operation, callback) {
                      console.log("getNextNumber " + operation.namespace + "," + operation.partitionId);
                      getModel(function(err) {
                          if (err) {
                              callback(err, null);
                  Severity: Minor
                  Found in blogic/SCTIdDataManager.js - About 1 hr to fix

                    Method callCis has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private List<Long> callCis(String operation, CISBulkRequest request, boolean includeSchemeName) throws CISClientException {
                            String bulkJobId;
                            String jobInfo = operation;
                            try {
                                CISBulkRequestResponse responseBody;
                    Severity: Minor
                    Found in java-client/src/main/java/org/snomed/cis/client/CISClient.java - About 1 hr 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 registerSctid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports.registerSctid = function registerSctid (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) {
                    Severity: Minor
                    Found in controllers/Sctid.js - About 1 hr to fix

                      Function registerNewSctId has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function registerNewSctId(operation, callback){
                          getSctid(operation.sctid,function(err,sctIdRecord){
                      
                              if (err) {
                                  callback(err, null);
                      Severity: Minor
                      Found in blogic/SCTIdDataManager.js - About 1 hr to fix

                        Function getSchemeId has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var getSchemeId=function (scheme,schemeId, callback){
                            if (schemeId==null || schemeId==""){
                                callback(throwErrMessage("Not valid schemeId."),null);
                                return;
                            }else{
                        Severity: Minor
                        Found in blogic/SchemeIdDataManager.js - About 1 hr to fix

                          Function registerNewSchemeId has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function registerNewSchemeId(scheme, operation, callback){
                              getSchemeId(scheme, operation.schemeId,function(err,schemeIdRecord){
                          
                                  if (err) {
                                      callback(err, null);
                          Severity: Minor
                          Found in blogic/SchemeIdDataManager.js - About 1 hr to fix

                            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;
                            Severity: Minor
                            Found in model/sctid.js - About 1 hr to fix

                              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;
                              Severity: Minor
                              Found in model/job.js - About 1 hr to fix

                                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;
                                Severity: Minor
                                Found in model/schemeid.js - About 1 hr to fix

                                  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) {
                                  Severity: Minor
                                  Found in controllers/SchemeIdBulk.js - About 1 hr to fix

                                    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) {
                                    Severity: Minor
                                    Found in controllers/SchemeIdBulk.js - About 1 hr to fix

                                      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) {
                                      Severity: Minor
                                      Found in controllers/SchemeIdBulk.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language