client/pkg/tuf/client.go

Summary

Maintainability
A
2 hrs
Test Coverage
D
63%

Method Client.setup has 7 return statements (exceeds 4 allowed).
Open

func (c *Client) setup(rootVersion int64, rootSha512 string) error {
    var rootBasename string
    if rootVersion == 0 {
        rootBasename = "root.json"
    } else {
Severity: Major
Found in client/pkg/tuf/client.go - About 45 mins to fix

    Method Client.initTufClient has 6 return statements (exceeds 4 allowed).
    Open

    func (c *Client) initTufClient() error {
        localDB, err := leveldbstore.FileLocalStore(c.metaLocalStoreDir)
        if err != nil {
            return fmt.Errorf("unable to init file local store: %w", err)
        }
    Severity: Major
    Found in client/pkg/tuf/client.go - About 40 mins to fix

      Method Client.saveMeta has 5 return statements (exceeds 4 allowed).
      Open

      func (c *Client) saveMeta() error {
          localDB, err := leveldbstore.FileLocalStore(c.metaLocalStoreDir)
          if err != nil {
              return fmt.Errorf("unable to init file local store: %w", err)
          }
      Severity: Major
      Found in client/pkg/tuf/client.go - About 35 mins to fix

        Function NewClient has 5 return statements (exceeds 4 allowed).
        Open

        func NewClient(repoUrl, metaLocalStoreDir, locksPath string) (*Client, error) {
            c := &Client{}
            c.metaLocalStoreDir = metaLocalStoreDir
            c.repoUrl = repoUrl
        
        
        Severity: Major
        Found in client/pkg/tuf/client.go - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status