realpython/members

View on GitHub
src/server/auth/helpers.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function ensureVerified has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function ensureVerified(req, res, next) {
    if (req.user) {
      if (req.user.verified) {
        const userID = parseInt(req.user.id);
        userQueries.getSingleUserByID(userID, (err, user) => {
Severity: Minor
Found in src/server/auth/helpers.js - About 1 hr to fix

    Function ensureAdmin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function ensureAdmin(req, res, next) {
        if (req.user) {
          if (req.user.admin) {
            const userID = parseInt(req.user.id);
            // return next();
    Severity: Minor
    Found in src/server/auth/helpers.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status