Showing 162 of 258 total issues

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

etl.verify = function(context, workspace, collection, documents, callback) {
Severity: Minor
Found in lib/dispatch/beacon.js - About 35 mins to fix

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

      run: function (context, workspace, collection, document, callback) {
    Severity: Minor
    Found in lib/dispatch/collections.js - About 35 mins to fix

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

        run: function (context, workspace, collection, payload, callback) {
      Severity: Minor
      Found in lib/dispatch/collections.js - About 35 mins to fix

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

          run: function (context, workspace, collection, metric, callback) {
        Severity: Minor
        Found in lib/dispatch/metrics.js - About 35 mins to fix

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

            run: function (context, workspace, role, payload, callback) {
          Severity: Minor
          Found in lib/dispatch/roles.js - About 35 mins to fix

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

              run: function (context, workspace, collection, dimension, callback) {
            Severity: Minor
            Found in lib/dispatch/dimensions.js - About 35 mins to fix

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

                run: function (context, workspace, username, password, callback) {
              Severity: Minor
              Found in lib/dispatch/users.js - About 35 mins to fix

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

                auth.validateRoute = function (req, modulename, action, callback) {
                  if (!callback) {
                    callback = action;
                    action = modulename;
                    modulename = req;
                Severity: Minor
                Found in lib/common/auth.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 {
                      start: new Date(_startdate),
                      end: new Date(_enddate)
                    };
                Severity: Major
                Found in lib/dispatch/query.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return {
                        last_n_items: parseInt(m[1], 10)
                      };
                  Severity: Major
                  Found in lib/dispatch/query.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return process.nextTick(function () {
                          return callback(null, _action);
                        });
                    Severity: Major
                    Found in lib/common/auth.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return {
                            start: new Date(_startdate),
                            end: new Date(_enddate)
                          };
                      Severity: Major
                      Found in lib/dispatch/query.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return {
                              start: new Date(_startdate),
                              end: new Date(_enddate)
                            };
                        Severity: Major
                        Found in lib/dispatch/query.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              if (obj.constructor == (new RegExp).constructor) return "regex";
                          Severity: Major
                          Found in lib/common/index.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return {
                                  start: new Date(_startdate),
                                  end: new Date(_enddate)
                                };
                            Severity: Major
                            Found in lib/dispatch/query.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return localRoute(req, res);
                              Severity: Major
                              Found in lib/webserver/routes/index.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return {
                                      start: new Date(_startdate),
                                      end: new Date(_enddate)
                                    };
                                Severity: Major
                                Found in lib/dispatch/query.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return process.nextTick(function () {
                                            return callback(new AuthErrorTemplate('Failed to validate token [2] [' + token + ']'));
                                          });
                                  Severity: Major
                                  Found in lib/common/auth.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return {
                                          start: new Date(_startdate),
                                          end: new Date(_enddate)
                                        };
                                    Severity: Major
                                    Found in lib/dispatch/query.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                return router.responseSuccess(result, headers, req, res);
                                      Severity: Major
                                      Found in lib/dispatch/query.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language