maestro-server/server-app

View on GitHub

Showing 36 of 80 total issues

Function DBRepository has 127 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 5 hrs to fix

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

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

      Function PersistenceApp has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PersistenceApp = (Entity, PersistenceServices = DPersistenceServices) => {
      
          return {
      
              find (req, res, next) {
      Severity: Major
      Found in app/core/applications/persistenceApplication.js - About 3 hrs to fix

        Function ApplicationReport has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ApplicationReport = (Entity, PersistenceServices = DPersistenceServices) => {
        
            return {
                create(req, res, next) {
                    _.defaults(req.body, Entity.defaults || {});
        Severity: Major
        Found in app/reports/applications/persistenceReports.js - About 3 hrs to fix

          Function HTTPService has a Cognitive Complexity of 24 (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 3 hrs 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 AuthService has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const AuthService = (Entity) => {
          
              const DBRepository = FactoryDBRepository(Entity);
          
              return {
          Severity: Major
          Found in app/identity/services/AuthService.js - About 2 hrs to fix

            Function AccessServices has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function DepsServices has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const DepsServices = (Entity, field, FactoryDBRepository = DFactoryDBRepository, FactoryDBBatch = DFactoryDBBatch) => {
              
                  const DBRepository = FactoryDBRepository(Entity);
                  const DBBatch = FactoryDBBatch(Entity);
              
              
              Severity: Major
              Found in app/inventory/services/DependenciesServices.js - About 2 hrs to fix

                Function PersistenceGraph has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const PersistenceGraph = (Entity, PersistenceServices = DPersistenceServices) => {
                
                    return {
                        find(req, res, next) {
                            const field = 'query';
                Severity: Major
                Found in app/analytics/applications/persistenceGraph.js - About 2 hrs to fix

                  Function ApplicationConnection has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ApplicationConnection = (Entity, PersistenceServices = DPersistenceServices) => {
                  
                      return {
                          info(req, res, next) {
                  
                  
                  Severity: Major
                  Found in app/inventory/applications/persistenceConnection.js - About 2 hrs to fix

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

                    module.exports = function (query, field = 'query', rules = []) {
                        if (query.hasOwnProperty(field)) {
                            let omits = [];
                    
                            for (let rule in rules) {
                    Severity: Minor
                    Found in app/core/applications/transforms/filterHooks.js - About 2 hrs 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 Persistence has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function WrapperPersistenceApp has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const WrapperPersistenceApp = (Entity) => (ACEntity) => (FactoryPesistenceApp = DFactoryPesistenceApp) => (apply) => {
                      
                          const PesistenceApp = FactoryPesistenceApp(Entity);
                      
                          const factoryWrapper = function(method, access) {
                      Severity: Minor
                      Found in app/core/applications/wrapperPersistenceApplication.js - About 1 hr to fix

                        Function connections has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const connections = function () {
                            const module = 'connections';
                            let template = null;
                        
                            const populate = async function () {
                        Severity: Minor
                        Found in app/reports/services/templates/connections.js - About 1 hr to fix

                          Function UsersPersistence has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const UsersPersistence = (Entity) => {
                          
                              const DBRepository = FactoryDBRepository(Entity);
                          
                              return Object.assign({}, Persistence(Entity), {
                          Severity: Minor
                          Found in app/identity/services/PersistenceServices.js - About 1 hr to fix

                            Function HTTPService has 42 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 UploaderRepository has 38 lines of code (exceeds 25 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 1 hr to fix

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

                                    const validateFile = (file, opts) => {
                                    
                                        const defaultParams = {
                                            maxsize: 1630240, //~1 mb,
                                            minsize: 1024, // 1 kbs
                                    Severity: Minor
                                    Found in app/core/services/validator/uploadValid.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language