IHTSDO/component-identifier-service

View on GitHub

Showing 1,102 of 1,102 total issues

Avoid deeply nested control flow statements.
Open

                            if (err) {
                                console.log("Error accessing groups", err);
                                callback(able);
                            } else {
                                result.forEach(function(loopGroup){
Severity: Major
Found in controllers/SchemeIdBulk.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (err) {
                                    console.log("Error accessing groups", err);
                                    callback(able);
                                } else {
                                    result.forEach(function(loopGroup){
    Severity: Major
    Found in controllers/Sctid.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                                  if (err) {
      
                                                      return next(err.message);
                                                  }
      Severity: Major
      Found in controllers/SctidBulk.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

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

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

          var getSchemeId=function (scheme, schemeId, systemId, autoSysId, callback) {
              Sync(function () {
                  if (!schemes[scheme.toUpperCase()].validSchemeId(schemeId)){
          
                      callback("Not valid SchemeId: " + schemeId, null);
          Severity: Minor
          Found in blogic/SchemeIdBulkDataManager.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

          Avoid deeply nested control flow statements.
          Open

                                      if (err) {
                                          console.log("Error accessing groups", err);
                                          callback(able);
                                      } else {
                                          result.forEach(function(loopGroup){
          Severity: Major
          Found in controllers/SctidBulk.js - About 45 mins to fix

            Function findFieldSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            job.findFieldSelect=function(query, fields,limit, skip,orderBy, callback){
            Severity: Minor
            Found in model/job.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                          if (err) {
                                                              var str = "[ERROR] " + (new Date()).getTime() + ": namespace=" + namespace + ", partition=" + partitionId + ". " + err;
                                                              console.log(str);
                                                          }
              Severity: Major
              Found in blogic/BulkIdCreation.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

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

                  Avoid deeply nested control flow statements.
                  Open

                                                          if (sctIdRecord != null) {
                                                              sctIdRecord.jobId = operation.jobId;
                                                              sctid.save.sync(null,sctIdRecord);
                                                              canContinue = false;
                                                          }
                  Severity: Major
                  Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (err) {
                                                    console.log("Error accessing groups", err);
                                                    callback(able);
                                                } else {
                                                    result.forEach(function(loopGroup){
                    Severity: Major
                    Found in controllers/Sctid.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                                      if (err) {
                      
                                                                          return next(err.message);
                                                                      }
                      Severity: Major
                      Found in controllers/Sctid.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if (err) {
                                                        console.log("Error accessing groups", err);
                                                        callback(able);
                                                    } else {
                                                        result.forEach(function(loopGroup){
                        Severity: Major
                        Found in controllers/SctidBulk.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if (res) {
                                                  var syscode = res[0];
                                                  var i = -1;
                                                  for (i = 0; i < records.length; i++) {
                                                      if (records[i][5] == syscode) {
                          Severity: Major
                          Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (!thisPartition) {
                                                                callback("Partition not found for key:" + JSON.stringify(key));
                                                                return;
                                                            }
                            Severity: Major
                            Found in blogic/IdReposition.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/SCTIdBulkDataManager.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/SCTIdBulkDataManager.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if (cont == records.length) {
                                                                      callback(null);
                                                                      return;
                                  
                                                                  }
                                  Severity: Major
                                  Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                                if (err) {
                                    
                                                                                    return next(err.message);
                                                                                }
                                    Severity: Major
                                    Found in controllers/Sctid.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                                      if (err) {
                                      
                                                                                          return next(err.message);
                                                                                      }
                                      Severity: Major
                                      Found in controllers/SctidBulk.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language