Preparing report...

Report for github.com/kata-containers/runtime

A+    Excellent!    Found 91 issues across 361 files

Tweet

gofmt90%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint85%

Golint is a linter for Go source code.

    • runtime/cli/kata-check_amd64.go
    • Line 57: warning: don't use underscores in Go names; const ioctl_ACRN_CREATE_VM should be ioctlACRNCREATEVM (golint)
    • Line 58: warning: don't use underscores in Go names; const ioctl_ACRN_DESTROY_VM should be ioctlACRNDESTROYVM (golint)
    • Line 60: warning: don't use underscores in Go names; type acrn_create_vm should be acrnCreateVM (golint)
    • Line 63: warning: don't use underscores in Go names; struct field vcpu_num should be vcpuNum (golint)
    • Line 66: warning: don't use underscores in Go names; struct field vm_flag should be vmFlag (golint)
    • Line 67: warning: don't use underscores in Go names; struct field req_buf should be reqBuf (golint)
    • runtime/virtcontainers/persist/fs/mockfs.go
    • Line 16: warning: exported type MockFS should have comment or be unexported (golint)
    • Line 21: warning: exported function MockStorageRootPath should have comment or be unexported (golint)
    • Line 25: warning: exported function MockRunStoragePath should have comment or be unexported (golint)
    • Line 29: warning: exported function MockRunVMStoragePath should have comment or be unexported (golint)
    • Line 33: warning: exported function MockStorageDestroy should have comment or be unexported (golint)
    • Line 37: warning: exported function MockFSInit should have comment or be unexported (golint)
    • runtime/virtcontainers/device/config/config.go
    • Line 74: warning: comment on exported const VhostUserBlkMajor should be of the form "VhostUserBlkMajor ..." (golint)
    • Line 78: warning: exported const VhostUserSCSIMajor should have comment (or a comment on this block) or be unexported (golint)
    • Line 364: warning: exported function GetVhostUserNodeStat should have comment or be unexported (golint)
    • runtime/pkg/katautils/container_engine.go
    • Line 12: warning: exported type CtrEngine should have comment or be unexported (golint)
    • Line 17: warning: exported var DockerLikeCtrEngines should have comment or be unexported (golint)
    • Line 20: warning: exported method CtrEngine.Init should have comment or be unexported (golint)
    • Line 31: warning: exported method CtrEngine.Inspect should have comment or be unexported (golint)
    • Line 36: warning: exported method CtrEngine.Pull should have comment or be unexported (golint)
    • Line 40: warning: exported method CtrEngine.Create should have comment or be unexported (golint)
    • Line 44: warning: exported method CtrEngine.Rm should have comment or be unexported (golint)
    • Line 48: warning: exported method CtrEngine.GetRootfs should have comment or be unexported (golint)
    • runtime/pkg/katatestutils/utils.go
    • Line 11: warning: exported type RuntimeConfigOptions should have comment or be unexported (golint)
    • Line 49: warning: exported function MakeRuntimeConfigFileData should have comment or be unexported (golint)
    • runtime/virtcontainers/types/bridges.go
    • Line 13: warning: exported const PCIBridgeMaxCapacity should have comment or be unexported (golint)
    • Line 23: warning: exported const CCWBridgeMaxCapacity should have comment or be unexported (golint)
    • Line 26: warning: exported const CCW should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Bridge should have comment or be unexported (golint)
    • Line 46: warning: exported function NewBridge should have comment or be unexported (golint)
    • Line 67: warning: exported method Bridge.AddDevice should have comment or be unexported (golint)
    • Line 87: warning: exported method Bridge.RemoveDevice should have comment or be unexported (golint)
    • runtime/virtcontainers/pkg/cgroups/utils.go
    • Line 19: warning: comment on exported const CgroupKataPrefix should be of the form "CgroupKataPrefix ..." (golint)
    • Line 28: warning: exported function RenameCgroupPath should have comment or be unexported (golint)
    • Line 39: warning: comment on exported function ValidCgroupPath should be of the form "ValidCgroupPath ..." (golint)
    • Line 62: warning: exported function IsSystemdCgroup should have comment or be unexported (golint)
    • Line 79: warning: exported function DeviceToCgroupDevice should have comment or be unexported (golint)
    • Line 114: warning: exported function DeviceToLinuxDevice should have comment or be unexported (golint)
    • runtime/cli/release.go
    • Line 21: warning: exported type ReleaseCmd should have comment or be unexported (golint)
    • Line 47: warning: comment on exported const ReleaseURLEnvVar should be of the form "ReleaseURLEnvVar ..." (golint)
    • Line 50: warning: exported const RelCmdList should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported method ReleaseCmd.Valid should have comment or be unexported (golint)
    • Line 371: warning: exported function HandleReleaseVersions should have comment or be unexported (golint)
    • runtime/virtcontainers/persist/api/network.go
    • Line 16: warning: exported type NetworkInterface should have comment or be unexported (golint)
    • Line 43: warning: exported type PhysicalEndpoint should have comment or be unexported (golint)
    • Line 49: warning: exported type MacvtapEndpoint should have comment or be unexported (golint)
    • Line 55: warning: exported type TapEndpoint should have comment or be unexported (golint)
    • Line 59: warning: exported type TuntapEndpoint should have comment or be unexported (golint)
    • Line 63: warning: exported type BridgedMacvlanEndpoint should have comment or be unexported (golint)
    • Line 67: warning: exported type VethEndpoint should have comment or be unexported (golint)
    • Line 71: warning: exported type IPVlanEndpoint should have comment or be unexported (golint)
    • Line 75: warning: exported type VhostUserEndpoint should have comment or be unexported (golint)
    • runtime/virtcontainers/pkg/types/pcipath.go
    • Line 28: warning: exported function PciSlotFromString should have comment or be unexported (golint)
    • Line 38: warning: exported function PciSlotFromInt should have comment or be unexported (golint)
    • Line 72: warning: exported method PciPath.IsNil should have comment or be unexported (golint)
    • Line 76: warning: exported function PciPathFromString should have comment or be unexported (golint)
    • Line 93: warning: exported function PciPathFromSlots should have comment or be unexported (golint)
    • runtime/pkg/katatestutils/constraints_api.go
    • Line 76: warning: comment on exported function NewTestConstraint should be of the form "NewTestConstraint ..." (golint)
    • Line 139: warning: comment on exported function NeedRoot should be of the form "NeedRoot ..." (golint)
    • Line 250: warning: comment on exported function NeedKernelVersionEquals should be of the form "NeedKernelVersionEquals ..." (golint)
    • runtime/virtcontainers/persist/fs/fs.go
    • Line 242: warning: exported method FS.Lock should have comment or be unexported (golint)
    • Line 280: warning: exported method FS.GlobalWrite should have comment or be unexported (golint)
    • Line 313: warning: exported method FS.GlobalRead should have comment or be unexported (golint)
    • Line 335: warning: exported method FS.RunStoragePath should have comment or be unexported (golint)
    • Line 339: warning: exported method FS.RunVMStoragePath should have comment or be unexported (golint)
    • runtime/virtcontainers/utils/proc_linux.go
    • Line 19: warning: exported type Proc should have comment or be unexported (golint)
    • Line 23: warning: exported function NewProc should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method Proc.Children should be of the form "Children ..." (golint)
    • runtime/virtcontainers/persist/manager.go
    • Line 21: warning: exported const RootFSName should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function EnableMockTesting should have comment or be unexported (golint)
    • Line 49: warning: comment on exported function GetDriverByName should be of the form "GetDriverByName ..." (golint)
    • runtime/virtcontainers/device/drivers/utils.go
    • Line 24: warning: exported const PCIDomain should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type PCISysFsType should have comment or be unexported (golint)
    • Line 33: warning: exported var PCISysFsDevices should have comment or be unexported (golint)
    • Line 37: warning: exported type PCISysFsProperty should have comment or be unexported (golint)
    • Line 40: warning: exported var PCISysFsDevicesClass should have comment or be unexported (golint)
    • Line 96: warning: exported function GetVFIODeviceType should have comment or be unexported (golint)
    • runtime/virtcontainers/clh.go
    • Line 97: warning: exported type CloudHypervisorVersion should have comment or be unexported (golint)
    • Line 103: warning: comment on exported type CloudHypervisorState should be of the form "CloudHypervisorState ..." (with optional leading article) (golint)
    • runtime/virtcontainers/pkg/cgroups/manager.go
    • Line 28: warning: exported type Config should have comment or be unexported (golint)
    • Line 45: warning: exported type Manager should have comment or be unexported (golint)
    • Line 268: warning: exported method Manager.GetCgroups should have comment or be unexported (golint)
    • Line 274: warning: exported method Manager.GetPaths should have comment or be unexported (golint)
    • Line 280: warning: exported method Manager.Destroy should have comment or be unexported (golint)
    • Line 313: warning: comment on exported method Manager.RemoveDevice should be of the form "RemoveDevice ..." (golint)
    • Line 332: warning: exported method Manager.SetCPUSet should have comment or be unexported (golint)
    • runtime/virtcontainers/utils/utils.go
    • Line 263: warning: exported type MemUnit should have comment or be unexported (golint)
    • Line 265: warning: exported method MemUnit.ToMiB should have comment or be unexported (golint)
    • Line 269: warning: exported method MemUnit.ToBytes should have comment or be unexported (golint)
    • Line 274: warning: exported const Byte should have comment (or a comment on this block) or be unexported (golint)
    • Line 280: warning: comment on exported const LoggerBinaryName should be of the form "LoggerBinaryName ..." (golint)
    • Line 283: warning: exported type ProgramLogger should have comment or be unexported (golint)
    • Line 287: warning: exported function NewProgramLogger should have comment or be unexported (golint)
    • Line 291: warning: exported method ProgramLogger.StartLogger should have comment or be unexported (golint)
    • runtime/virtcontainers/device/drivers/vhost_user_fs.go
    • Line 24: warning: exported method VhostUserFSDevice.Attach should have comment or be unexported (golint)
    • Line 52: warning: exported method VhostUserFSDevice.Detach should have comment or be unexported (golint)
    • Line 57: warning: exported method VhostUserFSDevice.DeviceType should have comment or be unexported (golint)

gocyclo95%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • runtime/virtcontainers/container.go
    • Line 1038: warning: cyclomatic complexity 23 of function (*Container).stop() is high (> 15) (gocyclo)
    • Line 1236: warning: cyclomatic complexity 19 of function (*Container).update() is high (> 15) (gocyclo)
    • Line 876: warning: cyclomatic complexity 18 of function (*Container).create() is high (> 15) (gocyclo)
    • runtime/virtcontainers/qemu.go
    • Line 1107: warning: cyclomatic complexity 27 of function (*qemu).hotplugAddBlockDevice() is high (> 15) (gocyclo)
    • Line 467: warning: cyclomatic complexity 22 of function (*qemu).createSandbox() is high (> 15) (gocyclo)
    • Line 776: warning: cyclomatic complexity 19 of function (*qemu).startSandbox() is high (> 15) (gocyclo)
    • Line 1326: warning: cyclomatic complexity 19 of function (*qemu).hotplugVFIODevice() is high (> 15) (gocyclo)
    • Line 1430: warning: cyclomatic complexity 17 of function (*qemu).hotplugNetDevice() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!