bcgov/vue3-scaffold

View on GitHub
app/src/middleware/authentication.ts

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 2 of 2 total issues

Function currentUser has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

export const currentUser = async (req: Request, res: Response, next: NextFunction) => {
const authorization = req.get('Authorization');
const currentUser: CurrentUser = {
authType: AuthType.NONE,
tokenPayload: null
Severity: Minor
Found in app/src/middleware/authentication.ts - About 3 hrs to fix

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

export const currentUser = async (req: Request, res: Response, next: NextFunction) => {
const authorization = req.get('Authorization');
const currentUser: CurrentUser = {
authType: AuthType.NONE,
tokenPayload: null
Severity: Minor
Found in app/src/middleware/authentication.ts - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status