RouteInjector/route-injector

View on GitHub

Showing 220 of 414 total issues

Avoid too many return statements within this function.
Open

                        return [4 /*yield*/, util_2.promisify(mkdirp)(path.dirname(outputFile))];
Severity: Major
Found in lib/engine/routeinjector/images/GalleryInjector.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                            return kick();
    Severity: Major
    Found in lib/engine/routeinjector/routes/auth/utils.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return [7 /*endfinally*/];
      Severity: Major
      Found in lib/utils/FSUtils.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            if (!(limit > 0)) return [3 /*break*/, 12];
        Severity: Major
        Found in lib/utils/HooksUtils.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return false;
          Severity: Major
          Found in lib/app/internals/AuthManager.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return false;
            Severity: Major
            Found in lib/app/internals/AuthManager.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return true;
              Severity: Major
              Found in lib/app/internals/AuthManager.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return [3 /*break*/, 13];
                Severity: Major
                Found in lib/utils/HooksUtils.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return [3 /*break*/, 11];
                  Severity: Major
                  Found in lib/utils/HooksUtils.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        if (!(limit > 1)) return [3 /*break*/, 10];
                    Severity: Major
                    Found in lib/utils/HooksUtils.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return [4 /*yield*/, _a.call(stream_1)];
                      Severity: Major
                      Found in lib/utils/FSUtils.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return [4 /*yield*/, new Promise(function (resolve) {
                                                    func(doc_1, resolve, state);
                                                })];
                        Severity: Major
                        Found in lib/utils/HooksUtils.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return true;
                          Severity: Major
                          Found in lib/app/internals/AuthManager.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                return [3 /*break*/, 5];
                            Severity: Major
                            Found in lib/utils/HooksUtils.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                  return [2 /*return*/, state.result || partial];
                              Severity: Major
                              Found in lib/utils/HooksUtils.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                    if (!doc_1) return [3 /*break*/, 14];
                                Severity: Major
                                Found in lib/utils/HooksUtils.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                      return [4 /*yield*/, cursor.next()];
                                  Severity: Major
                                  Found in lib/utils/HooksUtils.js - About 30 mins to fix

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

                                    exports.logout = function (req, res) {
                                        log.info(req.user);
                                        if (aconf.login.stateless) {
                                            res.statusCode = statusCode.BAD_REQUEST;
                                            res.json({result: 'auth mode is stateless'});
                                    Severity: Minor
                                    Found in lib/engine/routeinjector/routes/auth.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 errorHandlers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private errorHandlers(): void {
                                            if(this.config.application.notFound == undefined) {
                                                this.app.use(ExpressMiddlewares.notFoundHandler());
                                            } else {
                                                if(this.config.application.notFound == "disabled") {
                                    Severity: Minor
                                    Found in lib/app/internals/ExpressManager.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 ModelsLoader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    var ModelsLoader = /** @class */ (function () {
                                        function ModelsLoader(config, pluginRegistry) {
                                            this._models = {};
                                            ModelsLoader.logger.trace("Creating ModelsLoader instance");
                                            this.config = config;
                                    Severity: Minor
                                    Found in lib/app/internals/ModelsLoader.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