IHTSDO/component-identifier-service

View on GitHub

Showing 213 of 1,102 total issues

Function createPermission has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

module.exports.createPermission = function createPermission(permission, callback){
    dbInit.getDB(function (err, pdb, model) {
        if (err)
            throw err;
        else{
Severity: Minor
Found in blogic/NamespaceDataManager.js - About 35 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 getNextId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

var getNextId= function (previousId){
    var prefix=previousId.substring(0,previousId.indexOf("-"));
    var hexBase=previousId.substr(previousId.indexOf("-") + 1);

    if (hexBase.toUpperCase()>="FFFFF") {
Severity: Minor
Found in blogic/SchemeIdGenerator/SnomedID.js - About 35 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 releaseSctid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

var releaseSctid=function (operation, callback){
    getSctid(operation.sctid,function(err,sctIdRecord){

        if (err) {
            callback(err, null);
Severity: Minor
Found in blogic/SCTIdDataManager.js - About 35 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 too many return statements within this function.
Open

    return null;
Severity: Major
Found in utils/SctIdHelper.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return null;
    Severity: Major
    Found in utils/SctIdHelper.js - About 30 mins to fix

      Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      auxDescription.create=function(sctIdRecord,callback){
      
          db.getDB(function (err,connection)
          {
      
      
      Severity: Minor
      Found in model/auxDescription.js - About 25 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      auxConcept.create=function(sctIdRecord,callback){
      
          db.getDB(function (err,connection)
          {
      
      
      Severity: Minor
      Found in model/auxConcept.js - About 25 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 getSyncSctidBySystemId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      var getSyncSctidBySystemId=function (namespaceId,systemId, callback) {
          Sync(function () {
              var objQuery = {namespace: namespaceId, systemId: systemId};
              try {
                  var sctIdRecord = sctid.findBySystemId.sync(null, objQuery);
      Severity: Minor
      Found in blogic/SCTIdBulkDataManager.js - About 25 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      auxRelationship.create=function(sctIdRecord,callback){
      
          db.getDB(function (err,connection)
          {
      
      
      Severity: Minor
      Found in model/auxRelationship.js - About 25 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 getSyncSchemeIdBySystemId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      var getSyncSchemeIdBySystemId=function (scheme, systemId, callback) {
          Sync(function () {
              var objQuery = {scheme: scheme.toUpperCase(), systemId: systemId};
              try {
                  var schemeIdRecord = schemeid.findBySystemId.sync(null, objQuery);
      Severity: Minor
      Found in blogic/SchemeIdBulkDataManager.js - About 25 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 bulkInsert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      schemeid.bulkInsert=function(records,callback){
      
          db.getDB(function (err,connection)
          {
      
      
      Severity: Minor
      Found in model/schemeid.js - About 25 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 bulkInsert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      sctid.bulkInsert=function(records,callback){
      
          db.getDB(function (err,connection)
          {
      
      
      Severity: Minor
      Found in model/sctid.js - About 25 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 validSchemeId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      var validSchemeId=function(id){
          if (!id){
              return false;
          }
          if (id.length!=5 ){
      Severity: Minor
      Found in blogic/SchemeIdGenerator/CTV3ID.js - About 25 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

      Severity
      Category
      Status
      Source
      Language