firebase/superstatic

View on GitHub
src/middleware/files.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function exports has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function () {
  return function (req, res, next) {
    const config = req.superstatic;
    const trailingSlashBehavior = config.trailingSlash;

Severity: Major
Found in src/middleware/files.js - About 4 hrs to fix

    Avoid too many return statements within this function.
    Open

                      return next();
    Severity: Major
    Found in src/middleware/files.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return next();
      Severity: Major
      Found in src/middleware/files.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                      return providerResult(req, res, appendedPath).then(
                        (appendedPathResult) => {
                          if (appendedPathResult) {
                            // Okay, back to trailing slash behavior
                            if (trailingSlashBehavior === false && hasTrailingSlash) {
        Severity: Major
        Found in src/middleware/files.js - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status