sillygod/cdp-cache

View on GitHub
cache.go

Summary

Maintainability
A
1 hr
Test Coverage
C
78%

Function judgeResponseShouldCacheOrNot has 7 return statements (exceeds 4 allowed).
Open

func judgeResponseShouldCacheOrNot(req *http.Request,
    statusCode int,
    respHeaders http.Header,
    privateCache bool) ([]cacheobject.Reason, time.Time, []cacheobject.Warning, *cacheobject.Object, error) {

Severity: Major
Found in cache.go - About 45 mins to fix

    Function getCacheStatus has 7 return statements (exceeds 4 allowed).
    Open

    func getCacheStatus(req *http.Request, response *Response, config *Config) (bool, time.Time) {
        // NOTE: it seems that we can remove lock timeout
        if response.Code == http.StatusPartialContent || response.snapHeader.Get("Content-Range") != "" {
            return false, now().Add(config.LockTimeout)
        }
    Severity: Major
    Found in cache.go - About 45 mins to fix

      TODO found
      Open

          // TODO: how to handle when the bucket's num is changed
      Severity: Minor
      Found in cache.go by fixme

      TODO found
      Open

          // TODO: Maybe we can redesign here to get a better performance
      Severity: Minor
      Found in cache.go by fixme

      There are no issues that match your filters.

      Category
      Status