storipress/karbon

View on GitHub
packages/karbon/src/runtime/routes/snapshot-handler.ts

Summary

Maintainability
A
1 hr
Test Coverage

Function defineSnapshotHandler has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function defineSnapshotHandler(input: DefineSnapshotHandlerInput | Handler): any {
  const { handler, fixedName } = normalizeDefineSnapshotHandlerInput(input)
  return async (event: any) => {
    const _name = fixedName ? extractName(event.path) : event.context.params.name
    const parsedName = parseName(_name)
Severity: Minor
Found in packages/karbon/src/runtime/routes/snapshot-handler.ts - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

          return renderAsJavascript(result)
    Severity: Major
    Found in packages/karbon/src/runtime/routes/snapshot-handler.ts - About 30 mins to fix

      There are no issues that match your filters.

      Category
      Status