vorteil/vorteil

View on GitHub
pkg/cli/virtualizers.go

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function runFirecracker has 70 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func runFirecracker(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
    var err error
    if runtime.GOOS != "linux" {
        return errors.New("firecracker is only available on linux")
    }
Severity: Minor
Found in pkg/cli/virtualizers.go - About 1 hr to fix

    Function runHyperV has 60 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func runHyperV(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
        if runtime.GOOS != "windows" {
            return errors.New("hyper-v is only available on windows system")
        }
        if !hyperv.Allocator.IsAvailable() {
    Severity: Minor
    Found in pkg/cli/virtualizers.go - About 1 hr to fix

      Function runVMware has 58 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func runVMware(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
          if !vmware.Allocator.IsAvailable() {
              return errors.New("vmware is not installed on your system")
          }
      
      
      Severity: Minor
      Found in pkg/cli/virtualizers.go - About 1 hr to fix

        Function runVirtualBox has 58 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func runVirtualBox(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
            if !virtualbox.Allocator.IsAvailable() {
                return errors.New("virtualbox not found installed on system")
            }
            // Create base folder to store virtualbox vms so the socket can be grouped
        Severity: Minor
        Found in pkg/cli/virtualizers.go - About 1 hr to fix

          Function runQEMU has 57 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func runQEMU(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name string, diskOutput string) error {
          
              if !qemu.Allocator.IsAvailable() {
                  return errors.New("qemu not installed on system")
              }
          Severity: Minor
          Found in pkg/cli/virtualizers.go - About 1 hr to fix

            Function runFirecracker has 11 return statements (exceeds 4 allowed).
            Open

            func runFirecracker(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
                var err error
                if runtime.GOOS != "linux" {
                    return errors.New("firecracker is only available on linux")
                }
            Severity: Major
            Found in pkg/cli/virtualizers.go - About 1 hr to fix

              Function runHyperV has 10 return statements (exceeds 4 allowed).
              Open

              func runHyperV(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
                  if runtime.GOOS != "windows" {
                      return errors.New("hyper-v is only available on windows system")
                  }
                  if !hyperv.Allocator.IsAvailable() {
              Severity: Major
              Found in pkg/cli/virtualizers.go - About 1 hr to fix

                Function runVMware has 9 return statements (exceeds 4 allowed).
                Open

                func runVMware(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
                    if !vmware.Allocator.IsAvailable() {
                        return errors.New("vmware is not installed on your system")
                    }
                
                
                Severity: Major
                Found in pkg/cli/virtualizers.go - About 55 mins to fix

                  Function runVirtualBox has 9 return statements (exceeds 4 allowed).
                  Open

                  func runVirtualBox(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name, diskOutput string) error {
                      if !virtualbox.Allocator.IsAvailable() {
                          return errors.New("virtualbox not found installed on system")
                      }
                      // Create base folder to store virtualbox vms so the socket can be grouped
                  Severity: Major
                  Found in pkg/cli/virtualizers.go - About 55 mins to fix

                    Function runQEMU has 9 return statements (exceeds 4 allowed).
                    Open

                    func runQEMU(pkgReader vpkg.Reader, cfg *vcfg.VCFG, name string, diskOutput string) error {
                    
                        if !qemu.Allocator.IsAvailable() {
                            return errors.New("qemu not installed on system")
                        }
                    Severity: Major
                    Found in pkg/cli/virtualizers.go - About 55 mins to fix

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

                      func buildFirecracker(ctx context.Context, w io.WriteSeeker, cfg *vcfg.VCFG, args *vdisk.BuildArgs) (string, error) {
                          var err error
                          for i := range cfg.Networks {
                              if ips == nil {
                                  ips, err = iputil.NewIPStack()
                      Severity: Major
                      Found in pkg/cli/virtualizers.go - About 40 mins to fix

                        Your code does not pass gofmt in 5 places. Go fmt your code!
                        Open

                        package cli
                        Severity: Minor
                        Found in pkg/cli/virtualizers.go by gofmt

                        There are no issues that match your filters.

                        Category
                        Status