kubenetworks/kubevpn

View on GitHub
pkg/upgrade/upgrade.go

Summary

Maintainability
A
3 hrs
Test Coverage

Function downloadAndInstall has 13 return statements (exceeds 4 allowed).
Open

func downloadAndInstall(client *http.Client, url string) error {
    temp, err := os.CreateTemp("", "*.zip")
    if err != nil {
        return err
    }
Severity: Major
Found in pkg/upgrade/upgrade.go - About 1 hr to fix

    Function downloadAndInstall has 56 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func downloadAndInstall(client *http.Client, url string) error {
        temp, err := os.CreateTemp("", "*.zip")
        if err != nil {
            return err
        }
    Severity: Minor
    Found in pkg/upgrade/upgrade.go - About 1 hr to fix

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

      func NeedsUpgrade(ctx context.Context, client *http.Client, version string) (url string, latestVersion string, upgrade bool, err error) {
          latestVersion, url, err = util.GetManifest(client, runtime.GOOS, runtime.GOARCH)
          if err != nil {
              v := "https://github.com/kubenetworks/kubevpn/raw/master/plugins/stable.txt"
              var stream []byte
      Severity: Major
      Found in pkg/upgrade/upgrade.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status