gerard2p/koaton

View on GitHub
src/middleware/cached.js

Summary

Maintainability
A
1 hr
Test Coverage

Showing 1 of 1 total issue

Function cached has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export default async function cached (ctx, next) {
await next();
const body = ctx.body;
/* istanbul ignore if */
if (!body || ctx.response.get('ETag') || ctx.state.nocache) return;
Severity: Minor
Found in src/middleware/cached.js - About 1 hr to fix
Category
Status