IHTSDO/component-identifier-service

View on GitHub

Showing 213 of 1,102 total issues

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

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

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

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 insertSchemeIdRecord has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function insertSchemeIdRecord(newSchemeIdRecord, autoSysId, callback){
    Sync(function() {
        var err;
        var newSchemeIdRecord2;
        try {
Severity: Minor
Found in blogic/SchemeIdBulkDataManager.js - About 1 hr to fix

    Function isAbleUser has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function isAbleUser(namespaceId, user, callback){
        var able = false;
        security.admins.forEach(function(admin){
            if (admin == user)
                able = true;
    Severity: Minor
    Found in controllers/Sctid.js - About 1 hr to fix

      Function isAbleUser has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function isAbleUser(namespaceId, user, callback){
          var able = false;
          security.admins.forEach(function(admin){
              if (admin == user)
                  able = true;
      Severity: Minor
      Found in controllers/SctidBulk.js - About 1 hr to fix

        Function isSchemeAbleUser has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function isSchemeAbleUser(schemeName, user, callback){
            var able = false;
            security.admins.forEach(function(admin){
                if (admin == user)
                    able = true;
        Severity: Minor
        Found in controllers/Sctid.js - About 1 hr to fix

          Function isAbleUser has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function isAbleUser(schemeName, user, callback){
              var able = false;
              security.admins.forEach(function(admin){
                  if (admin == user)
                      able = true;
          Severity: Minor
          Found in controllers/SchemeId.js - About 1 hr to fix

            Function isSchemeAbleUser has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function isSchemeAbleUser(schemeName, user, callback){
                var able = false;
                security.admins.forEach(function(admin){
                    if (admin == user)
                        able = true;
            Severity: Minor
            Found in controllers/SctidBulk.js - About 1 hr to fix

              Function isAbleUser has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function isAbleUser(schemeName, user, callback){
                  var able = false;
                  security.admins.forEach(function(admin){
                      if (admin == user)
                          able = true;
              Severity: Minor
              Found in controllers/SchemeIdBulk.js - About 1 hr to fix

                Function getSctids has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var getSctids=function (sctidArray, callback) {
                
                    sctidArray.forEach(function (sctId) {
                
                        if (!sctIdHelper.validSCTId(sctId)) {
                Severity: Minor
                Found in blogic/SCTIdBulkDataManager.js - About 1 hr to fix

                  Function registerSchemeId has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var registerSchemeId=function (scheme, operation, callback){
                  
                      if (!operation.autoSysId) {
                          getSchemeIdBySystemId(scheme, operation.systemId, function (err, schemeId) {
                              if (err) {
                  Severity: Minor
                  Found in blogic/SchemeIdDataManager.js - About 1 hr to fix

                    Function registerSctid has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var registerSctid=function (operation, callback) {
                    
                        if (!operation.autoSysId) {
                            getSctidBySystemId(operation.namespace, operation.systemId, function (err, sctid) {
                                if (err) {
                    Severity: Minor
                    Found in blogic/SCTIdDataManager.js - About 1 hr to fix

                      Method callCis has 38 lines of code (exceeds 25 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

                        Function runner has 36 lines of code (exceeds 25 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

                          Function getJobRecords has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getJobRecords(jobId, callback) {
                          
                              bulkJob.findById({id: parseInt(jobId)}, function (err, jobRecord) {
                                  if (err) {
                                      callback(err, null);
                          Severity: Minor
                          Found in blogic/BulkJobDataManager.js - About 1 hr to fix

                            Function getNamespacesForUser has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function publishSctids has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function registerSctids has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                module.exports.registerSctids = function registerSctids (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/SctidBulk.js - About 1 hr to fix

                                  Function releaseSctids has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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