raveljs/ravel

View on GitHub

Showing 58 of 59 total issues

Avoid too many return statements within this function.
Open

        return new RouteTreeResult(keyValues, child.middleware, child.composedMiddleware);
Severity: Major
Found in lib/util/route-tree.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return 0;
    Severity: Major
    Found in lib/util/route-tree.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 1;
      Severity: Major
      Found in lib/util/route-tree.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return 1;
        Severity: Major
        Found in lib/util/route-tree.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return 0;
          Severity: Major
          Found in lib/util/route-tree.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return -1;
            Severity: Major
            Found in lib/util/route-tree.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return new RouteTreeResult(keyValues, this.middleware, this.composedMiddleware);
              Severity: Major
              Found in lib/util/route-tree.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return;
                Severity: Major
                Found in lib/util/response_cache.js - About 30 mins to fix

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

                    allowedMethods () {
                      const methods = [];
                      if (!this[Methods.HEAD].isEmpty) methods.push('HEAD');
                      if (!this[Methods.GET].isEmpty) methods.push('GET');
                      if (!this[Methods.PATCH].isEmpty) methods.push('PATCH');
                  Severity: Minor
                  Found in lib/util/route-tree.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 Module has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const Module = function (...args) {
                    if (args.length === 1 && typeof args[0] === 'string') {
                      return function (target, key, descriptor) {
                        Metadata.putClassMeta(target.prototype, '@role', 'type', 'Module');
                        if (typeof name === 'string') {
                  Severity: Minor
                  Found in lib/core/decorators/module.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 addRoute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    addRoute (pattern, pathComponents, middleware, catchAll = false) {
                      // check if we're done
                      if (pathComponents.length === 0) {
                        _middleware.set(this, middleware);
                        _composedMiddleware.set(this, compose(middleware));
                  Severity: Minor
                  Found in lib/util/route-tree.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

                  TODO found
                  Open

                     * TODO broken since we don't require file paths anymore.
                  Severity: Minor
                  Found in lib/core/reflect.js by fixme

                  TODO found
                  Open

                   * TODO broken since we don't require file paths anymore.
                  Severity: Minor
                  Found in lib/core/reflect.js by fixme

                  TODO found
                  Open

                     * TODO broken since we don't require file paths anymore.
                  Severity: Minor
                  Found in lib/core/reflect.js by fixme

                  TODO found
                  Open

                      // TODO ensure this is only used on Routes classes
                  Severity: Minor
                  Found in lib/core/decorators/mapping.js by fixme

                  TODO found
                  Open

                        this.redis && this.redis.quit(); // TODO callback?
                  Severity: Minor
                  Found in lib/core/websocket.js by fixme

                  TODO found
                  Open

                      // TODO ensure that this is only used on Resources and Routes
                  Severity: Minor
                  Found in lib/core/decorators/before.js by fixme

                  TODO found
                  Open

                     * TODO broken since we don't require file paths anymore.
                  Severity: Minor
                  Found in lib/core/reflect.js by fixme
                  Severity
                  Category
                  Status
                  Source
                  Language