Asymmetrik/mean2-starter

View on GitHub

Showing 101 of 230 total issues

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

    private getQuery(): any {
        let query: any;
        let elements: any[] = [];

        if (this.filters.bypassAC) {
Severity: Minor
Found in src/client/app/admin/user-management/admin-list-users.component.ts - About 1 hr to fix

    Function signupEmail has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports.signupEmail = function(user, req) {
        let defer = q.defer();
    
        req.app.render('../../admin/templates/user-signup-alert-email', {
            name: user.name,

      Function audit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports.audit = function(message, eventType, eventAction, eventActor, eventObject, eventMetadata) {
          let Audit = dbs.admin.model('Audit');
          let utilService = deps.utilService;
      
          // Extract additional metadata to audit
      Severity: Minor
      Found in src/server/app/audit/services/audit.server.service.js - About 1 hr to fix

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

        module.exports = function(app, db) {
        
            // Create a new HTTP server
            logger.info('Creating HTTP Server');
            var server = http.createServer(app);
        Severity: Minor
        Found in src/server/lib/socket.io.js - About 1 hr to fix

          Function searchTeamMembers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function searchTeamMembers(search, query, queryParams, team) {
                  let page = util.getPage(queryParams);
                  let limit = util.getLimit(queryParams);
          
                  let offset = page * limit;
          Severity: Minor
          Found in src/server/app/teams/services/teams.server.service.js - About 1 hr to fix

            Function verify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports.verify = function(role) {
            
                return function(req, res, next) {
                    // Grab the Authentication header
                    var authentication = req.headers.authentication;
            Severity: Minor
            Found in src/server/app/util/services/token-auth.server.service.js - About 1 hr to fix

              Function getValidationErrors has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              function getValidationErrors(err) {
                  var errors = [];
              
                  if(null != err.errors) {
                      for (var field in err.errors) {
              Severity: Minor
              Found in src/server/app/util/services/util.server.service.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 verify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports.verify = function(role) {
              
                  return function(req, res, next) {
                      // Grab the Authentication header
                      var authentication = req.headers.authentication;
              Severity: Minor
              Found in src/server/app/util/services/token-auth.server.service.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 getGlobbedPaths has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              let getGlobbedPaths = (globPatterns, excludes) => {
                  // URL paths regex
                  let urlRegex = new RegExp('^(?:[a-z]+:)?//', 'i');
              
                  // The output array
              Severity: Minor
              Found in src/server/config.js - About 1 hr to fix

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

                module.exports.get = function (id) {
                    var defer = q.defer();
                
                    if(null == id) {
                        return q.reject('id cannot be null or undefined');

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

                  KafkaSocket.prototype.kafkaPayloadHandler = function(consumer, message) {
                      // Gracefully handle empty messages by ignoring and logging
                      if (null == message) {
                          logger.warn('%s: Ignoring empty message %s', this.name, message);
                          return;
                  Severity: Minor
                  Found in src/server/app/util/sockets/kafka.server.socket.js - About 1 hr to fix

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

                    exports.adminUpdateUser = (req, res) => {
                    
                        // The persistence user
                        let user = req.userParam;
                    
                    

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

                      module.exports = function(delay) {
                          delay = delay || 10;
                      
                          // Store all the active timeouts
                          var timeouts = [];
                      Severity: Minor
                      Found in src/server/app/util/services/delayed-stream.server.service.js - About 1 hr to fix

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

                        EventSocket.prototype.socketPayloadHandler = function(eventName, message) {
                            // Gracefully handle empty messages by ignoring and logging
                            if (null == message) {
                                logger.warn('%s: Ignoring empty message %s', this.name, message);
                                return;
                        Severity: Minor
                        Found in src/server/app/util/sockets/event.server.socket.js - About 1 hr to fix

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

                              ngOnInit() {
                                  this.tag = new Tag();
                          
                                  this.route.params.subscribe((params: Params) => {
                                      this.mode = params[`mode`];
                          Severity: Minor
                          Found in src/client/app/teams/tags/manage-tag.component.ts - About 1 hr to fix

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

                                protected checkAdminAccess(url: string, route: ActivatedRouteSnapshot): boolean {
                                    if (!this.userStateService.user.isAdmin()) {
                                        // -----------------------------------------------------------
                                        // Check the role requirements for the route
                                        // -----------------------------------------------------------
                            Severity: Minor
                            Found in src/client/app/core/auth-guard.service.ts - About 1 hr to fix

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

                              module.exports.getErrorMessage = function(err) {
                                  var message = '';
                              
                                  if (null == err || typeof err === 'string') {
                                      message = err;
                              Severity: Minor
                              Found in src/server/app/core/controllers/errors.server.controller.js - About 1 hr to fix

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

                                function initMiddleware(app) {
                                    // Showing stack errors
                                    app.set('showStackError', true);
                                
                                    // Should be placed before express.static
                                Severity: Minor
                                Found in src/server/lib/express.js - About 1 hr to fix

                                  Function containsQuery has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  module.exports.containsQuery = function(schema, query, fields, search, limit, offset, sortArr, runCount) {
                                  Severity: Major
                                  Found in src/server/app/util/services/query.server.service.js - About 1 hr to fix

                                    Function pagingQuery has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    function pagingQuery(schema, find, projection, options, sort, limit, offset, runCount) {
                                    Severity: Major
                                    Found in src/server/app/util/services/query.server.service.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language