maestro-server/audit-app

View on GitHub

Showing 12 of 20 total issues

Function DBRepository has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DBRepository = (Entity, options = {}) => {

    const DB = Entity.dao;

    return {
Severity: Major
Found in app/core/repositories/DBRepository.js - About 3 hrs to fix

    Function ApplicationAudit has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ApplicationAudit = (EntityStorage) => (Entity, PersistenceServices = DPersistenceServices) => {
    
        const AuditTrackCharged = AuditTrack(PersistenceServices(Entity));
        const dUser = "MaestroServer";
    
    
    Severity: Major
    Found in app/audit/applications/persistenceAudit.js - About 2 hrs to fix

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

      const Persistence = (Entity, FactoryDBRepository = DFactoryDBRepository) => {
      
          const DBRepository = FactoryDBRepository(Entity);
      
          return {
      Severity: Major
      Found in app/core/services/PersistenceServices.js - About 2 hrs to fix

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

        Query.prototype.find = function (query, options) {
            let Model = this.model;
        
            query = _.assign({}, this.query, query);
        
        
        Severity: Minor
        Found in app/core/repositories/daos/connector/query.js - About 2 hrs to fix

          Function HTTPService has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

          const HTTPService = (url) => (header = {}) => {
          
              Object.assign(header, {Authorization: privateToken.token}); // inject private token, used to autheticate on private services
          
              const factoryRequest = (caller, path, args) => {
          Severity: Minor
          Found in app/core/services/HTTPService.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 HTTPService has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const HTTPService = (url) => (header = {}) => {
          
              Object.assign(header, {Authorization: privateToken.token}); // inject private token, used to autheticate on private services
          
              const factoryRequest = (caller, path, args) => {
          Severity: Minor
          Found in app/core/services/HTTPService.js - About 1 hr to fix

            Function exports has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = (Entity) => {
            
                return {
                    accessSingleRoleRefs: (collections, _id = false) => {
            
            
            Severity: Minor
            Found in app/core/applications/transforms/hateoasTransform.js - About 1 hr to fix

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

              module.exports = (PersistenceStorage) => (body, entity, entity_id, user, created=false) => {
              
                  return new Promise((resolve, reject) => {
              
                      if (!_.isEmpty(body)) {
              Severity: Minor
              Found in app/audit/services/libs/recordTrack.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

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

              Query.prototype.where = function (key, value) {
                  // if object was passed instead of key-value pair
                  // iterate over that object and call .where(key, value)
                  if (_.isObject(key)) {
                      let conditions = key;
              Severity: Minor
              Found in app/core/repositories/daos/connector/query.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

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

              Query.prototype.find = function (query, options) {
                  let Model = this.model;
              
                  query = _.assign({}, this.query, query);
              
              
              Severity: Minor
              Found in app/core/repositories/daos/connector/query.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 isID has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              const isID = (obj, relation, key = '_id') => {
                  const exist = _.get(obj, relation);
              
                  if(_.isArray(exist)) {
                      const interator = obj[relation].map(e=>isID(e, '', key));
              Severity: Minor
              Found in app/core/applications/transforms/mapRelationToObjectID.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function () {
                  const passport = new Passport();
              
                  const strategy = new Strategy(config.jwtSecret, function (payload, done) {
              
              
              Severity: Minor
              Found in app/audit/config/auth_conector_private.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