Chocobozzz/PeerTube

View on GitHub
client/src/standalone/videos/shared/auth-http.ts

Summary

Maintainability
A
3 hrs
Test Coverage

Function refreshFetch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private refreshFetch (url: string, options?: RequestInit) {
    return fetch(url, options)
      .then((res: Response) => {
        if (res.status !== HttpStatusCode.UNAUTHORIZED_401) return res

Severity: Minor
Found in client/src/standalone/videos/shared/auth-http.ts - About 1 hr to fix

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

            const refreshingTokenPromise = new Promise<void>((resolve, reject) => {
              const clientId: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
              const clientSecret: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
    
              const headers = new Headers()
    Severity: Minor
    Found in client/src/standalone/videos/shared/auth-http.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status