skyderby/skyderby

View on GitHub
public/mockServiceWorker.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function getResponse has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function getResponse(event, client, requestId) {
  const { request } = event
  const requestClone = request.clone()
  const getOriginalResponse = () => fetch(requestClone)

Severity: Major
Found in public/mockServiceWorker.js - About 2 hrs to fix

Avoid too many return statements within this function.
Open

  return event.respondWith(
    handleRequest(event, requestId).catch((error) => {
      if (error.name === 'NetworkError') {
        console.warn(
          '[MSW] Successfully emulated a network error for the "%s %s" request.',
Severity: Major
Found in public/mockServiceWorker.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return respondWithMock(clientMessage)
Severity: Major
Found in public/mockServiceWorker.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return getOriginalResponse()
Severity: Major
Found in public/mockServiceWorker.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return getOriginalResponse()
Severity: Major
Found in public/mockServiceWorker.js - About 30 mins to fix

There are no issues that match your filters.

Category
Status