alibaba/kt-connect

View on GitHub
pkg/kt/command/forward.go

Summary

Maintainability
A
1 hr
Test Coverage

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

func parsePort(args []string) (localPort int, remotePort int, err error) {
    if len(args) < 2 {
        // port not specified
        return -1, -1, nil
    } else if count := strings.Count(args[1], ":"); count == 0 {
Severity: Major
Found in pkg/kt/command/forward.go - About 40 mins to fix

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

    func NewForwardCommand() *cobra.Command {
        cmd := &cobra.Command{
            Use:   "forward",
            Short: "Redirect local port to a service or any remote address",
            PreRunE: func(cmd *cobra.Command, args []string) error {
    Severity: Major
    Found in pkg/kt/command/forward.go - About 40 mins to fix

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

      func Forward(args []string) error {
          ch, err := general.SetupProcess(util.ComponentForward)
          if err != nil {
              return err
          }
      Severity: Major
      Found in pkg/kt/command/forward.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status