portainer/portainer

View on GitHub
api/ldap/ldap.go

Summary

Maintainability
A
1 hr
Test Coverage

Function createConnectionForURL has 6 return statements (exceeds 4 allowed).
Open

func createConnectionForURL(url string, settings *portainer.LDAPSettings) (*ldap.Conn, error) {
    if settings.TLSConfig.TLS || settings.StartTLS {
        config, err := crypto.CreateTLSConfigurationFromDisk(settings.TLSConfig.TLSCACertPath, settings.TLSConfig.TLSCertPath, settings.TLSConfig.TLSKeyPath, settings.TLSConfig.TLSSkipVerify)
        if err != nil {
            return nil, err
Severity: Major
Found in api/ldap/ldap.go - About 40 mins to fix

    Method Service.AuthenticateUser has 5 return statements (exceeds 4 allowed).
    Open

    func (*Service) AuthenticateUser(username, password string, settings *portainer.LDAPSettings) error {
    
        connection, err := createConnection(settings)
        if err != nil {
            return err
    Severity: Major
    Found in api/ldap/ldap.go - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status