IHTSDO/component-identifier-service

View on GitHub

Showing 213 of 1,102 total issues

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

var insertRecords=function(records, scheme, key, autoSysId, callback) {
    Sync(function () {
        var err;
        try {
            schemeid.bulkInsert.sync(null, records);
Severity: Major
Found in blogic/SchemeIdBulkDataManager.js - About 2 hrs to fix

    Function relationshipIdBulkCreation has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var relationshipIdBulkCreation = function (namespace, partitionId, idsTotal, request, callback) {
    
    
        //console.log("step relationshipIdBulkCreation");
    
    
    Severity: Major
    Found in blogic/BulkIdCreation.js - About 2 hrs to fix

      Method run has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public void run(ApplicationArguments args) throws Exception {
              System.out.println("\nThis process will synchronise the sequence of every partition within every namespace\n" +
                      "from the source CIS instance to the target CIS instance\n" +
                      "where the partition is available on both sides.\n");

        Function getSctid has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports.getSctid = function getSctid (req, res, next) {
            var token = req.swagger.params.token.value;
            var sctid = req.swagger.params.sctid.value;
            var includeAdditionalIds = req.swagger.params.includeAdditionalIds.value;
            security.authenticate(token, function(err, data) {
        Severity: Major
        Found in controllers/Sctid.js - About 2 hrs to fix

          Function conceptIdBulkCreation has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var conceptIdBulkCreation = function (namespace, partitionId, idsTotal, request, callback) {
          
          
              //console.log("step conceptIdBulkCreation");
          
          
          Severity: Major
          Found in blogic/BulkIdCreation.js - About 2 hrs to fix

            Function descriptionIdBulkCreation has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var descriptionIdBulkCreation = function (namespace, partitionId, idsTotal, request, callback) {
            
            
                //console.log("step descriptionIdBulkCreation");
            
            
            Severity: Major
            Found in blogic/BulkIdCreation.js - About 2 hrs to fix

              Function createNamespace has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports.createNamespace = function createNamespace(objNamespace, callback){
                  dbInit.getDB(function (err, pdb, model) {
                      if (err)
                          throw err;
                      else{
              Severity: Major
              Found in blogic/NamespaceDataManager.js - About 2 hrs to fix

                Function find has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                job.find=function(query, limit, skip, callback){
                    db.getDB(function (err,connection)
                    {
                        if (err) throw err;
                        if (!query){
                Severity: Minor
                Found in model/job.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 getNamespaces has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports.getNamespaces = function getNamespaces (req, res, next) {
                    namespace.getNamespaces(function(err, namespaces) {
                        if (err)
                            return next(err.message);
                        else{
                Severity: Minor
                Found in controllers/Namespace.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 updateSchemeIds has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function generateSchemeIdSmallRequest has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function updateSctids has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var updateSctids=function (operation, callback){
                        var cont=0;
                        var records=[];
                        var error=false;
                        for (var i=0;i<operation.sctids.length;i++) {
                    Severity: Major
                    Found in blogic/SCTIdBulkDataManager.js - About 2 hrs to fix

                      Function find has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function save has a Cognitive Complexity of 15 (exceeds 5 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

                        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 idsRetrieve has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var idsRetrieve = function (request, callback) {
                        
                            if (request.partitionId.substr(1,1)=="0") {
                                conceptIdBulkCreation( request.namespace, request.partitionId, request.quantity, request, function(err, result){
                        
                        
                        Severity: Minor
                        Found in blogic/BulkIdCreation.js - 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 find has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        schemeid.find=function(query, limit, skip, callback){
                            db.getDB(function (err,connection)
                            {
                                if (err) throw err;
                                var swhere="";
                        Severity: Minor
                        Found in model/schemeid.js - About 1 hr to fix

                          Function find has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function getSchemeIds has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var getSchemeIds=function (scheme, schemeIdArray, callback) {
                            
                                schemeIdArray.forEach(function (schemeId) {
                                    if (schemeId == null || schemeId == "") {
                                        callback(throwErrMessage("SchemeId is null."), null);
                            Severity: Minor
                            Found in blogic/SchemeIdBulkDataManager.js - About 1 hr to fix

                              Function save has a Cognitive Complexity of 14 (exceeds 5 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

                              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 runner has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                              var runner = function (){
                                  namespaceDm.getNamespaces(function(err, namespaces) {
                                      if (err) {
                                          console.log("[ERROR] " + (new Date()).getTime() + ": namespace=" + namespace + ", partition=" + partitionId + ". " + err);
                                          return;
                              Severity: Minor
                              Found in blogic/BackEndIdRepoService.js - 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

                              Severity
                              Category
                              Status
                              Source
                              Language