waku-org/go-waku

View on GitHub
waku/v2/protocol/rln/keystore/keystore.go

Summary

Maintainability
A
2 hrs
Test Coverage
F
0%

Function save has 8 return statements (exceeds 4 allowed).
Open

func save(keystore *AppKeystore, path string) error {
    // We first backup the current keystore
    _, err := os.Stat(path)
    if err == nil {
        err := os.Rename(path, path+".bkp")
Severity: Major
Found in waku/v2/protocol/rln/keystore/keystore.go - About 50 mins to fix

    Method AppKeystore.GetMembershipCredentials has 7 return statements (exceeds 4 allowed).
    Open

    func (k *AppKeystore) GetMembershipCredentials(keystorePassword string, index *rln.MembershipIndex, filterMembershipContract MembershipContractInfo) (*MembershipCredentials, error) {
        // If there is only one, and index to laod nil, assume 0,
        // if there is more than one, complain if the index to load is nil
    
        var key Key
    Severity: Major
    Found in waku/v2/protocol/rln/keystore/keystore.go - About 45 mins to fix

      Method AppKeystore.AddMembershipCredentials has 6 return statements (exceeds 4 allowed).
      Open

      func (k *AppKeystore) AddMembershipCredentials(newCredential MembershipCredentials, password string) error {
          credentials, err := k.GetMembershipCredentials(password, &newCredential.TreeIndex, newCredential.MembershipContractInfo)
          if err != nil {
              return err
          }
      Severity: Major
      Found in waku/v2/protocol/rln/keystore/keystore.go - About 40 mins to fix

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

        func New(path string, appInfo AppInfo, logger *zap.Logger) (*AppKeystore, error) {
            logger = logger.Named("rln-keystore")
        
            _, err := os.Stat(path)
            if err != nil {
        Severity: Major
        Found in waku/v2/protocol/rln/keystore/keystore.go - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status