viney-shih/go-cache

View on GitHub
cache.go

Summary

Maintainability
A
3 hrs
Test Coverage

Method cache.MGet has 62 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (c *cache) MGet(ctx context.Context, prefix string, keys ...string) (Result, error) {
    cfg, ok := c.configs[prefix]
    if !ok {
        return nil, ErrPfxNotRegistered
    }
Severity: Minor
Found in cache.go - About 1 hr to fix

    Method cache.MGet has 9 return statements (exceeds 4 allowed).
    Open

    func (c *cache) MGet(ctx context.Context, prefix string, keys ...string) (Result, error) {
        cfg, ok := c.configs[prefix]
        if !ok {
            return nil, ErrPfxNotRegistered
        }
    Severity: Major
    Found in cache.go - About 55 mins to fix

      Method cache.GetByFunc has 9 return statements (exceeds 4 allowed).
      Open

      func (c *cache) GetByFunc(ctx context.Context, prefix, key string, container interface{}, getter OneTimeGetterFunc) error {
          cfg, ok := c.configs[prefix]
          if !ok {
              return ErrPfxNotRegistered
          }
      Severity: Major
      Found in cache.go - About 55 mins to fix

        There are no issues that match your filters.

        Category
        Status