gitlabhq/gitlab-shell

View on GitHub
internal/sshd/server_config.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method serverConfig.get has 53 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (s *serverConfig) get(ctx context.Context) *ssh.ServerConfig {
    var gssapiWithMICConfig *ssh.GSSAPIWithMICConfig
    if s.cfg.Server.GSSAPI.Enabled {
        gssApiServer, _ := NewGSSAPIServer(&s.cfg.Server.GSSAPI)

Severity: Minor
Found in internal/sshd/server_config.go - About 1 hr to fix

    Method serverConfig.get has 5 return statements (exceeds 4 allowed).
    Open

    func (s *serverConfig) get(ctx context.Context) *ssh.ServerConfig {
        var gssapiWithMICConfig *ssh.GSSAPIWithMICConfig
        if s.cfg.Server.GSSAPI.Enabled {
            gssApiServer, _ := NewGSSAPIServer(&s.cfg.Server.GSSAPI)
    
    
    Severity: Major
    Found in internal/sshd/server_config.go - About 35 mins to fix

      Method serverConfig.handleUserCertificate has 5 return statements (exceeds 4 allowed).
      Open

      func (s *serverConfig) handleUserCertificate(ctx context.Context, user string, cert *ssh.Certificate) (*ssh.Permissions, error) {
          if os.Getenv("FF_GITLAB_SHELL_SSH_CERTIFICATES") != "1" {
              return nil, fmt.Errorf("handleUserCertificate: feature is disabled")
          }
      
      
      Severity: Major
      Found in internal/sshd/server_config.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status