Asymmetrik/mean2-starter

View on GitHub

Showing 230 of 230 total issues

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;
    
    

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  (eua) => {
                      if (null == eua) {
                          next(new Error(`Failed to load User Agreement ${id}`));
                      }
                      else {
      src/server/app/teams/controllers/teams.server.controller.js on lines 167..175

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 56.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              .then(function(user) {
                  if (null == user) {
                      next(new Error(`Failed to load team member ${id}`));
                  }
                  else {
      Severity: Major
      Found in src/server/app/teams/controllers/teams.server.controller.js and 1 other location - About 1 hr to fix
      src/server/app/admin/controllers/users/eua.server.controller.js on lines 241..249

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 56.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                            if (null != queryParams.sort && null != queryParams.dir) {
                                sortArr = [{property: queryParams.sort, direction: queryParams.dir}];
                            }
                    Severity: Major
                    Found in src/server/app/teams/services/tags.server.service.js and 2 other locations - About 1 hr to fix
                    src/server/app/teams/services/teams.server.service.js on lines 275..277
                    src/server/app/teams/services/teams.server.service.js on lines 339..341

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 3 locations. Consider refactoring.
                    Open

                            if (null != queryParams.sort && null != queryParams.dir) {
                                sortArr = [{property: queryParams.sort, direction: queryParams.dir}];
                            }
                    Severity: Major
                    Found in src/server/app/teams/services/teams.server.service.js and 2 other locations - About 1 hr to fix
                    src/server/app/teams/services/tags.server.service.js on lines 115..117
                    src/server/app/teams/services/teams.server.service.js on lines 275..277

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

                      Identical blocks of code found in 3 locations. Consider refactoring.
                      Open

                              if (null != queryParams.sort && null != queryParams.dir) {
                                  sortArr = [{property: queryParams.sort, direction: queryParams.dir}];
                              }
                      Severity: Major
                      Found in src/server/app/teams/services/teams.server.service.js and 2 other locations - About 1 hr to fix
                      src/server/app/teams/services/tags.server.service.js on lines 115..117
                      src/server/app/teams/services/teams.server.service.js on lines 339..341

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              return auditService.audit('team created', 'team', 'create', TeamMember.auditCopy(creator), Team.auditCopy(newTeam), headers)
                                  .then(function() {
                                      // Save the new team
                                      return newTeam.save();
                                  })
                      Severity: Major
                      Found in src/server/app/teams/services/teams.server.service.js and 1 other location - About 1 hr to fix
                      src/server/app/teams/services/tags.server.service.js on lines 100..104

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                          findQuery.exec(function(error, results){
                              if(null != error){
                                  queryDefer.reject(error);
                              } else {
                                  queryDefer.resolve(results);
                      Severity: Major
                      Found in src/server/app/util/services/query.server.service.js and 2 other locations - About 1 hr to fix
                      src/server/app/util/services/query.server.service.js on lines 53..59
                      src/server/app/util/services/query.server.service.js on lines 169..175

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      MessageSocket.prototype.error = function(err) {
                          logger.error(err, 'MessageSocket: Client connection error');
                      
                          this.unsubscribe(this.getTopic());
                      };
                      Severity: Major
                      Found in src/server/app/messages/sockets/message.server.socket.js and 1 other location - About 1 hr to fix
                      src/server/app/notifications/sockets/notification.server.socket.js on lines 72..76

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                              baseQuery.count(function (error, results) {
                                  if (null != error) {
                                      countDefer.reject(error);
                                  } else {
                                      countDefer.resolve(results);
                      Severity: Major
                      Found in src/server/app/util/services/query.server.service.js and 2 other locations - About 1 hr to fix
                      src/server/app/util/services/query.server.service.js on lines 64..70
                      src/server/app/util/services/query.server.service.js on lines 169..175

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              return auditService.audit('tag deleted', 'tag', 'delete', TeamMember.auditCopy(user), Tag.auditCopy(tag), headers)
                                  .then(function() {
                                      // Delete the tag
                                      return tag.remove();
                                  });
                      Severity: Major
                      Found in src/server/app/teams/services/tags.server.service.js and 1 other location - About 1 hr to fix
                      src/server/app/teams/services/teams.server.service.js on lines 204..208

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 55.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language