maestro-server/server-app

View on GitHub

Showing 42 of 102 total issues

Function ApplicationSchedulers has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ApplicationSchedulers = (Entity, PersistenceServices = DPersistenceServices) => {

    return {
        find(req, res, next) {
            const field = 'query';
Severity: Minor
Found in app/reports/applications/persistenceScheduler.js - About 1 hr to fix

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

    const CallReportApi = (owner_user = null, req = null) => {
    
        return {
            create(e) {
                const data = {
    Severity: Minor
    Found in app/reports/applications/transform/callReportApi.js - About 1 hr to fix

      Function AuthApp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const AuthApp = (Entity) => {
      
          return {
              login (req, res, next) {
      
      
      Severity: Minor
      Found in app/identity/applications/authApplication.js - About 1 hr to fix

        Function validateFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const validateFile = (file, opts) => {
        
            const defaultParams = {
                maxsize: process.env.MAESTRO_UPLOAD_MAXSIZE | 16302400, //~10 mb,
                minsize: process.env.MAESTRO_UPLOAD_MINSIZE | 1, // 1 kbs
        Severity: Minor
        Found in app/core/services/validator/uploadValid.js - About 1 hr to fix

          Function AccessApp has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const AccessApp = (Entity, AccessServices = DAccessServices) => {
          
              return {
          
                  update: (req, res, next) => {
          Severity: Minor
          Found in app/core/applications/accessApplication.js - About 1 hr to fix

            Function HealthCheck has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const HealthCheck = () => {
            
                const handle_services = (Service) => {
                    const {name} = Service;
            
            
            Severity: Minor
            Found in app/core/applications/healthCheckApplication.js - About 1 hr to fix

              Function DatacentersConnection has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const DatacentersConnection = (result, req, PersistenceServices, Entity) => {
                  const dc_id = _.get(result, 'dc_id');
              
                  return {
                      connected() {
              Severity: Minor
              Found in app/inventory/services/DatacentersConnection.js - About 1 hr to fix

                Function persistenceSystem has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const persistenceSystem = (IEntity) => (Entity) => {
                
                    return {
                        create(req, res, next) {
                            PersistenceServices(Entity)
                Severity: Minor
                Found in app/inventory/applications/persistenceRelationSystem.js - About 1 hr to fix

                  Function mailerConnector has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const mailerConnector = (mailer = DMailer) => {
                  
                      if (!mailer.isConnected()) {
                          try {
                              factoryValid(
                  Severity: Minor
                  Found in app/core/repositories/smtp/mailerConnector.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 DepsApp has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DepsApp = (Entity, DepServices = DDepServices) => {
                      
                          const field = 'deps';
                      
                          return {
                      Severity: Minor
                      Found in app/inventory/applications/dependenciesApplication.js - About 1 hr to fix

                        Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                async render(data) {
                                    if (!template)
                                        template = await populate();
                        
                                    const {task, _id} = data;
                        Severity: Minor
                        Found in app/reports/services/templates/connections.js - About 1 hr to fix

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

                              connect() {
                          
                                  const smtpConfig = {
                                      host: process.env.SMTP_HOST,
                                      port: process.env.SMTP_PORT,
                          Severity: Minor
                          Found in app/core/repositories/smtp/factoryMailer.js - About 1 hr to fix

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

                            const MapFileType = (type=null) => {
                                const tprivate = {
                                    "application/json": "json",
                                    "text/csv": "csv",
                                    "text/plain": "txt"
                            Severity: Minor
                            Found in app/core/repositories/maps/mapFileType.js - About 1 hr to fix

                              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 validateFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const validateFile = (file, opts) => {
                              
                                  const defaultParams = {
                                      maxsize: process.env.MAESTRO_UPLOAD_MAXSIZE | 16302400, //~10 mb,
                                      minsize: process.env.MAESTRO_UPLOAD_MINSIZE | 1, // 1 kbs
                              Severity: Minor
                              Found in app/core/services/validator/uploadValid.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 HealthCheck has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const HealthCheck = () => {
                              
                                  const handle_services = (Service) => {
                                      const {name} = Service;
                              
                              
                              Severity: Minor
                              Found in app/core/applications/healthCheckApplication.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 UploaderRepository has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const UploaderRepository = (folder) => {
                              
                                  factoryValid(
                                      _.pick(process.env, ['AWS_S3_BUCKET_NAME', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY']),
                                      s3Valid
                              Severity: Minor
                              Found in app/core/repositories/uploaderS3Repository.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              module.exports = (password) => (obj) => {
                              
                                  if(obj.hasOwnProperty('password')) {
                                      if(obj && bcrypt.compareSync(password, obj.password)) {
                                          return obj;
                              Severity: Minor
                              Found in app/identity/services/validator/validPassMatch.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