Asymmetrik/mean2-starter

View on GitHub

Showing 101 of 230 total issues

Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

UserSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
Severity: Minor
Found in src/server/app/admin/models/user.server.model.js - About 35 mins to fix

    Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    CacheEntrySchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
    Severity: Minor
    Found in src/server/app/access-checker/models/cache-entry.server.model.js - About 35 mins to fix

      Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      TeamSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
      Severity: Minor
      Found in src/server/app/teams/models/team.server.model.js - About 35 mins to fix

        Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        TagSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
        Severity: Minor
        Found in src/server/app/teams/models/tags.server.model.js - About 35 mins to fix

          Function addMemberToTeam has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function addMemberToTeam(user, team, role, requester, headers) {
          Severity: Minor
          Found in src/server/app/teams/services/teams.server.service.js - About 35 mins to fix

            Function updateMemberRole has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function updateMemberRole(user, team, role, requester, headers) {
            Severity: Minor
            Found in src/server/app/teams/services/teams.server.service.js - About 35 mins to fix

              Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              AuditSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
              Severity: Minor
              Found in src/server/app/audit/models/audit.server.model.js - About 35 mins to fix

                Function search has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                UserAgreementSchema.statics.search = function(queryTerms, searchTerms, limit, offset, sortArr) {
                Severity: Minor
                Found in src/server/app/admin/models/eua.server.model.js - About 35 mins to fix

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

                  let initDerivedConfig = (config) => {
                      if (config.app && config.app.url && config.app.url.protocol && config.app.url.host) {
                          config.app.baseUrlWithoutPort = `${config.app.url.protocol}://${config.app.url.host}`;
                  
                          if (config.app.url.port) {
                  Severity: Minor
                  Found in src/server/config.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 checkAccess has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected checkAccess(url: string, route: ActivatedRouteSnapshot): boolean {
                          let requiresAuthentication: boolean = true; // default this to true unless told otherwise...
                  
                          // Only set it to false if it is explicitly set
                          if (null != route.data && (route.data as any).requiresAuthentication === false) {
                  Severity: Minor
                  Found in src/client/app/core/auth-guard.service.ts - 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 requiresAny has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports.requiresAny = (requirements) => {
                      return (req) => {
                  
                          // Apply the requirements
                          let error;
                  Severity: Minor
                  Found in src/server/app/admin/controllers/users.server.controller.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 checkExternalRoles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports.checkExternalRoles = function(user, configAuth) {
                      // If there are required roles, check for them
                      if (null != configAuth && _.isArray(configAuth.requiredRoles) && configAuth.requiredRoles.length > 0) {
                          // Get the user roles
                          var userRoles = (null != user && _.isArray(user.externalRoles)) ? user.externalRoles : [];
                  Severity: Minor
                  Found in src/server/app/admin/services/users.authorization.server.service.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

                  Avoid too many return statements within this function.
                  Open

                      return Date.parse(date);
                  Severity: Major
                  Found in src/server/app/util/services/util.server.service.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return null;
                    Severity: Major
                    Found in src/client/app/shared/utc-date-pipe/utc-date-utils.service.ts - About 30 mins to fix

                      Function search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      exports.search = function(req, res) {
                          let search = req.body.s || null;
                          let query = req.body.q || {};
                          query = util.toMongoose(query);
                      
                      
                      Severity: Minor
                      Found in src/server/app/audit/controllers/audit.server.controller.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 validatePassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public validatePassword(p1: string, p2: string): any {
                              p1 = (_.isString(p1) && p1.trim().length > 0) ? p1 : undefined;
                              p2 = (_.isString(p2) && p2.trim().length > 0) ? p2 : undefined;
                      
                              if (p1 !== p2) {
                      Severity: Minor
                      Found in src/client/app/admin/authentication/authentication.service.ts - 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 ignorePayload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      KafkaSocket.prototype.ignorePayload = function(rawMessage, json, consumer) {
                          // Ignore any payloads that are too old.
                          if (null != ignoreOlderThan) {
                              var now = Date.now();
                              var messageTime = this.getMessageTime(json);
                      Severity: Minor
                      Found in src/server/app/util/sockets/kafka.server.socket.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 containsQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports.containsQuery = function(schema, query, fields, search, limit, offset, sortArr, runCount) {
                          // Initialize find to null
                          var find = generateFind(query);
                          var projection = {};
                          var options = {};
                      Severity: Minor
                      Found in src/server/app/util/services/query.server.service.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 requiresRole has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports.requiresRole = function(role) {
                          return function(req) {
                      
                              // Verify that the user and tag are on the request
                              let user = req.user.toObject();
                      Severity: Minor
                      Found in src/server/app/teams/controllers/tags.server.controller.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 getConsumer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      KafkaConsumer.prototype.getConsumer = function() {
                          let self = this;
                      
                          // Initialize the deferred promise, if we don't already have one.
                          self.deferred = self.deferred || q.defer();
                      Severity: Minor
                      Found in src/server/lib/kafka-consumer.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