kubenetworks/kubevpn

View on GitHub
pkg/handler/tools.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function Complete has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Complete(ctx context.Context, route *core.Route) error {
    if v, ok := os.LookupEnv(config.EnvInboundPodTunIPv4); !ok || v != "" {
        return nil
    }

Severity: Minor
Found in pkg/handler/tools.go - About 1 hr to fix

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

    func Complete(ctx context.Context, route *core.Route) error {
        if v, ok := os.LookupEnv(config.EnvInboundPodTunIPv4); !ok || v != "" {
            return nil
        }
    
    
    Severity: Major
    Found in pkg/handler/tools.go - About 50 mins to fix

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

      func getDHCPServerClient(ctx context.Context, namespace string) (rpc.DHCPClient, error) {
          cert, ok := os.LookupEnv(config.TLSCertKey)
          if !ok {
              return nil, fmt.Errorf("can not get %s from env", config.TLSCertKey)
          }
      Severity: Major
      Found in pkg/handler/tools.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status