IHTSDO/component-identifier-service

View on GitHub

Showing 213 of 1,102 total issues

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

              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
                                Severity
                                Category
                                Status
                                Source
                                Language