go-sprout/sprout

View on GitHub
registry/crypto/helpers.go

Summary

Maintainability
A
3 hrs
Test Coverage

Method CryptoRegistry.parsePrivateKeyPEM has 10 return statements (exceeds 4 allowed).
Open

func (ch *CryptoRegistry) parsePrivateKeyPEM(pemBlock string) (crypto.PrivateKey, error) {
    block, _ := pem.Decode([]byte(pemBlock))
    if block == nil {
        return nil, errors.New("no PEM data in input")
    }
Severity: Major
Found in registry/crypto/helpers.go - About 1 hr to fix

    Method CryptoRegistry.generateSignedCertificateWithKeyInternal has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        cn string,
        ips []any,
        alternateDNS []any,
        daysValid int,
        ca Certificate,
    Severity: Minor
    Found in registry/crypto/helpers.go - About 45 mins to fix

      Method CryptoRegistry.generateSelfSignedCertificateWithKeyInternal has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          cn string,
          ips []any,
          alternateDNS []any,
          daysValid int,
          priv crypto.PrivateKey,
      Severity: Minor
      Found in registry/crypto/helpers.go - About 35 mins to fix

        Method CryptoRegistry.generateSignedCertificateWithKeyInternal has 5 return statements (exceeds 4 allowed).
        Open

        func (ch *CryptoRegistry) generateSignedCertificateWithKeyInternal(
            cn string,
            ips []any,
            alternateDNS []any,
            daysValid int,
        Severity: Major
        Found in registry/crypto/helpers.go - About 35 mins to fix

          Method CryptoRegistry.getCertAndKey has 5 return statements (exceeds 4 allowed).
          Open

          func (ch *CryptoRegistry) getCertAndKey(
              template *x509.Certificate,
              signeeKey crypto.PrivateKey,
              parent *x509.Certificate,
              signingKey crypto.PrivateKey,
          Severity: Major
          Found in registry/crypto/helpers.go - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status