IHTSDO/component-identifier-service

View on GitHub

Showing 1,102 of 1,102 total issues

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

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

    Function releaseSchemeIds has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function deprecateSchemeIds has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function getNamespace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        var getNamespace=function(sctid){
            if (sctid){
                if (!validSCTId(sctid)){
                    return null;
                }
        Severity: Minor
        Found in utils/SctIdHelper.js - About 55 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 getSequence has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        var getSequence=function(sctid){
            if (sctid){
                if (!validSCTId(sctid)){
                    return null;
                }
        Severity: Minor
        Found in utils/SctIdHelper.js - About 55 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 authenticate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports.authenticate = function authenticate (token, callback) {
            if (authenticationCache[token]) {
                var now = Date.now();
                var ago = (Date.now() - authenticationCache[token].timestamp);
                if (ago < (60000*60)) {
        Severity: Minor
        Found in blogic/Security.js - About 55 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 count has a Cognitive Complexity of 9 (exceeds 5 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 55 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 (diff) {
                                            sctIdToRegister = diff;
                                        }
        Severity: Major
        Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

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

            Avoid deeply nested control flow statements.
            Open

                                        if (limit && limit > 0 && limit < cont) {
                                            break;
                                        }
            Severity: Major
            Found in model/schemeid.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/SchemeId.js - About 45 mins to fix

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

                schemeid.updateJobId=function(existingSystemId, scheme, jobId, callback){
                
                    db.getDB(function (err,connection)
                    {
                        if (err) {
                Severity: Minor
                Found in model/schemeid.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 (limit && limit > 0 && limit < cont) {
                                                break;
                                            }
                Severity: Major
                Found in model/job.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (limit && limit > 0 && limit < cont) {
                                                  break;
                                              }
                  Severity: Major
                  Found in model/job.js - About 45 mins to fix

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

                    sctid.updateJobId=function(existingSystemId, jobId, callback){
                    
                        db.getDB(function (err,connection)
                        {
                            if (err) {
                    Severity: Minor
                    Found in model/sctid.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 (!data) {
                                                            callback("Partition not found for key:" + JSON.stringify(key));
                                                            return;
                                                        }
                    Severity: Major
                    Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if (seq == null) {
                                                          callback("Partition not found for key:" + JSON.stringify(key));
                                                          return;
                                                      }
                      Severity: Major
                      Found in blogic/SCTIdBulkDataManager.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 key = [parseInt(operation.namespace), operation.partitionId.toString()];
                                                    var seq = null;
                        Severity: Major
                        Found in blogic/SCTIdBulkDataManager.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (total > 0){
                                                              namespaceResult.forEach(function(namespaceR){
                                                                  sctid.count({namespace: namespaceR.namespace}, function (err, namespaceCount){
                                                                      if (err)
                                                                          callback(err, null);
                          Severity: Major
                          Found in blogic/HomeDataManager.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for (CISPartition sourcePartition : sourcePartitions) {
                                                        CISPartition targetPartition = targetPartitionMap.get(sourcePartition.getPartitionId());
                                                        if (targetPartition != null) {
                                                            System.out.println("Source Partition:" + sourcePartition.toString());
                                                            System.out.println("Target Partition:" + targetPartition.toString());
                              Severity
                              Category
                              Status
                              Source
                              Language