fabiocicerchia/go-proxy-cache

View on GitHub
cache/cache.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function StoreMetadata has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

func StoreMetadata(ctx context.Context, domainID string, method string, url url.URL, meta []string, expiration time.Duration) (bool, error) {
Severity: Minor
Found in cache/cache.go - About 45 mins to fix

    Method Object.RetrieveFullPage has 6 return statements (exceeds 4 allowed).
    Open

    func (c *Object) RetrieveFullPage() error {
        obj := &URIObj{}
    
        meta, err := FetchMetadata(c.DomainID, c.CurrentURIObject.Method, c.CurrentURIObject.URL)
        if err != nil {
    Severity: Major
    Found in cache/cache.go - About 40 mins to fix

      Method Object.StoreFullPage has 6 return statements (exceeds 4 allowed).
      Open

      func (c Object) StoreFullPage(ctx context.Context, expiration time.Duration) (bool, error) {
          if !c.IsStatusAllowed() || !c.IsMethodAllowed() || expiration < 1 {
              logger.GetGlobal().WithFields(log.Fields{
                  "ReqID": c.ReqID,
              }).Debugf(
      Severity: Major
      Found in cache/cache.go - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status