Preparing report...

Report for github.com/threefoldtech/zos

A+    Excellent!    Found 44 issues across 247 files

Tweet

gofmt98%

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!


gocyclo91%

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.

    • zos/pkg/vm/ch.go
    • Line 20: warning: cyclomatic complexity 17 of function (*Machine).Run() is high (> 15) (gocyclo)
    • zos/cmds/identityd/main.go
    • Line 278: warning: cyclomatic complexity 24 of function upgradeLoop() is high (> 15) (gocyclo)
    • Line 84: warning: cyclomatic complexity 17 of function main() is high (> 15) (gocyclo)
    • zos/pkg/provision/engine.go
    • Line 256: warning: cyclomatic complexity 18 of function (*Engine).provision() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 17 of function (*Engine).Run() is high (> 15) (gocyclo)
    • zos/pkg/capacity/dmi/dmi_test.go
    • Line 824: warning: cyclomatic complexity 17 of function TestParseTestMultpleSectionsWithSameTypeStr() is high (> 15) (gocyclo)
    • Line 641: warning: cyclomatic complexity 16 of function TestParseMultipleSectionsSimple() is high (> 15) (gocyclo)
    • zos/pkg/flist/flist.go
    • Line 166: warning: cyclomatic complexity 22 of function (*flistModule).mount() is high (> 15) (gocyclo)
    • Line 552: warning: cyclomatic complexity 17 of function waitPidFile() is high (> 15) (gocyclo)

golint93%

Golint is a linter for Go source code.

    • zos/pkg/stubs/version_monitor_stub.go
    • Line 9: warning: exported type VersionMonitorStub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewVersionMonitorStub should have comment or be unexported (golint)
    • Line 26: warning: exported method VersionMonitorStub.Version should have comment or be unexported (golint)
    • zos/cmds/modules/zui/net.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • zos/pkg/stubs/container_stub.go
    • Line 8: warning: exported type ContainerModuleStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewContainerModuleStub should have comment or be unexported (golint)
    • Line 25: warning: exported method ContainerModuleStub.Delete should have comment or be unexported (golint)
    • Line 38: warning: exported method ContainerModuleStub.Inspect should have comment or be unexported (golint)
    • Line 54: warning: exported method ContainerModuleStub.List should have comment or be unexported (golint)
    • Line 70: warning: exported method ContainerModuleStub.ListNS should have comment or be unexported (golint)
    • Line 86: warning: exported method ContainerModuleStub.Run should have comment or be unexported (golint)
    • zos/pkg/stubs/identity_stub.go
    • Line 8: warning: exported type IdentityManagerStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewIdentityManagerStub should have comment or be unexported (golint)
    • Line 25: warning: exported method IdentityManagerStub.Decrypt should have comment or be unexported (golint)
    • Line 41: warning: exported method IdentityManagerStub.DecryptECDH should have comment or be unexported (golint)
    • Line 57: warning: exported method IdentityManagerStub.Encrypt should have comment or be unexported (golint)
    • Line 73: warning: exported method IdentityManagerStub.EncryptECDH should have comment or be unexported (golint)
    • Line 89: warning: exported method IdentityManagerStub.FarmID should have comment or be unexported (golint)
    • Line 105: warning: exported method IdentityManagerStub.NodeID should have comment or be unexported (golint)
    • Line 117: warning: exported method IdentityManagerStub.PrivateKey should have comment or be unexported (golint)
    • Line 129: warning: exported method IdentityManagerStub.Sign should have comment or be unexported (golint)
    • Line 145: warning: exported method IdentityManagerStub.Verify should have comment or be unexported (golint)
    • zos/pkg/stubs/provision_stub.go
    • Line 9: warning: exported type ProvisionStub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewProvisionStub should have comment or be unexported (golint)
    • Line 26: warning: exported method ProvisionStub.Counters should have comment or be unexported (golint)
    • Line 45: warning: exported method ProvisionStub.DecommissionCached should have comment or be unexported (golint)
    • zos/pkg/stubs/storage_stub.go
    • Line 9: warning: exported type StorageModuleStub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewStorageModuleStub should have comment or be unexported (golint)
    • Line 26: warning: exported method StorageModuleStub.Allocate should have comment or be unexported (golint)
    • Line 42: warning: exported method StorageModuleStub.BrokenDevices should have comment or be unexported (golint)
    • Line 54: warning: exported method StorageModuleStub.BrokenPools should have comment or be unexported (golint)
    • Line 66: warning: exported method StorageModuleStub.CreateFilesystem should have comment or be unexported (golint)
    • Line 82: warning: exported method StorageModuleStub.Find should have comment or be unexported (golint)
    • Line 98: warning: exported method StorageModuleStub.GetCacheFS should have comment or be unexported (golint)
    • Line 114: warning: exported method StorageModuleStub.ListFilesystems should have comment or be unexported (golint)
    • Line 130: warning: exported method StorageModuleStub.Monitor should have comment or be unexported (golint)
    • Line 149: warning: exported method StorageModuleStub.Path should have comment or be unexported (golint)
    • Line 165: warning: exported method StorageModuleStub.ReleaseFilesystem should have comment or be unexported (golint)
    • Line 178: warning: exported method StorageModuleStub.Total should have comment or be unexported (golint)
    • zos/pkg/stubs/flist_stub.go
    • Line 8: warning: exported type FlisterStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewFlisterStub should have comment or be unexported (golint)
    • Line 25: warning: exported method FlisterStub.FlistHash should have comment or be unexported (golint)
    • Line 41: warning: exported method FlisterStub.HashFromRootPath should have comment or be unexported (golint)
    • Line 57: warning: exported method FlisterStub.Mount should have comment or be unexported (golint)
    • Line 73: warning: exported method FlisterStub.NamedMount should have comment or be unexported (golint)
    • Line 89: warning: exported method FlisterStub.NamedUmount should have comment or be unexported (golint)
    • Line 102: warning: exported method FlisterStub.Umount should have comment or be unexported (golint)
    • zos/pkg/stubs/zdb_stub.go
    • Line 8: warning: exported type ZDBAllocaterStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewZDBAllocaterStub should have comment or be unexported (golint)
    • Line 25: warning: exported method ZDBAllocaterStub.Allocate should have comment or be unexported (golint)
    • Line 41: warning: exported method ZDBAllocaterStub.Find should have comment or be unexported (golint)
    • zos/pkg/stubs/network_stub.go
    • Line 10: warning: exported type NetworkerStub should have comment or be unexported (golint)
    • Line 16: warning: exported function NewNetworkerStub should have comment or be unexported (golint)
    • Line 27: warning: exported method NetworkerStub.Addrs should have comment or be unexported (golint)
    • Line 43: warning: exported method NetworkerStub.CreateNR should have comment or be unexported (golint)
    • Line 59: warning: exported method NetworkerStub.DMZAddresses should have comment or be unexported (golint)
    • Line 78: warning: exported method NetworkerStub.DeleteNR should have comment or be unexported (golint)
    • Line 91: warning: exported method NetworkerStub.GetDefaultGwIP should have comment or be unexported (golint)
    • Line 110: warning: exported method NetworkerStub.GetIPv6From4 should have comment or be unexported (golint)
    • Line 126: warning: exported method NetworkerStub.GetNet should have comment or be unexported (golint)
    • Line 142: warning: exported method NetworkerStub.GetPublicIPv6Subnet should have comment or be unexported (golint)
    • Line 158: warning: exported method NetworkerStub.GetSubnet should have comment or be unexported (golint)
    • Line 174: warning: exported method NetworkerStub.Join should have comment or be unexported (golint)
    • Line 190: warning: exported method NetworkerStub.Leave should have comment or be unexported (golint)
    • Line 203: warning: exported method NetworkerStub.PubTapExists should have comment or be unexported (golint)
    • Line 219: warning: exported method NetworkerStub.PublicAddresses should have comment or be unexported (golint)
    • Line 238: warning: exported method NetworkerStub.PublicIPv4Support should have comment or be unexported (golint)
    • Line 250: warning: exported method NetworkerStub.Ready should have comment or be unexported (golint)
    • Line 263: warning: exported method NetworkerStub.RemovePubTap should have comment or be unexported (golint)
    • Line 276: warning: exported method NetworkerStub.RemoveTap should have comment or be unexported (golint)
    • Line 289: warning: exported method NetworkerStub.SetupPubTap should have comment or be unexported (golint)
    • Line 305: warning: exported method NetworkerStub.SetupTap should have comment or be unexported (golint)
    • Line 321: warning: exported method NetworkerStub.TapExists should have comment or be unexported (golint)
    • Line 337: warning: exported method NetworkerStub.YggAddresses should have comment or be unexported (golint)
    • Line 356: warning: exported method NetworkerStub.ZDBDestroy should have comment or be unexported (golint)
    • Line 369: warning: exported method NetworkerStub.ZDBPrepare should have comment or be unexported (golint)
    • Line 385: warning: exported method NetworkerStub.ZOSAddresses should have comment or be unexported (golint)
    • zos/pkg/stubs/upgrade_stub.go
    • Line 8: warning: exported type UpgradeModuleStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewUpgradeModuleStub should have comment or be unexported (golint)
    • Line 25: warning: exported method UpgradeModuleStub.Version should have comment or be unexported (golint)
    • zos/pkg/stubs/vdisk_stub.go
    • Line 8: warning: exported type VDiskModuleStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewVDiskModuleStub should have comment or be unexported (golint)
    • Line 25: warning: exported method VDiskModuleStub.Allocate should have comment or be unexported (golint)
    • Line 41: warning: exported method VDiskModuleStub.Deallocate should have comment or be unexported (golint)
    • Line 54: warning: exported method VDiskModuleStub.Exists should have comment or be unexported (golint)
    • Line 66: warning: exported method VDiskModuleStub.Inspect should have comment or be unexported (golint)
    • Line 82: warning: exported method VDiskModuleStub.List should have comment or be unexported (golint)
    • zos/cmds/modules/networkd/addr_watcher.go
    • Line 23: warning: exported type WatchedLinks should have comment or be unexported (golint)
    • Line 30: warning: exported function NewWatchedLinks should have comment or be unexported (golint)
    • Line 73: warning: exported method WatchedLinks.Forever should have comment or be unexported (golint)
    • zos/pkg/stubs/host_monitor_stub.go
    • Line 9: warning: exported type HostMonitorStub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewHostMonitorStub should have comment or be unexported (golint)
    • Line 26: warning: exported method HostMonitorStub.Uptime should have comment or be unexported (golint)
    • zos/pkg/stubs/system_monitor_stub.go
    • Line 9: warning: exported type SystemMonitorStub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewSystemMonitorStub should have comment or be unexported (golint)
    • Line 26: warning: exported method SystemMonitorStub.CPU should have comment or be unexported (golint)
    • Line 45: warning: exported method SystemMonitorStub.Disks should have comment or be unexported (golint)
    • Line 64: warning: exported method SystemMonitorStub.Memory should have comment or be unexported (golint)
    • Line 83: warning: exported method SystemMonitorStub.Nics should have comment or be unexported (golint)
    • zos/pkg/stubs/vmd_stub.go
    • Line 8: warning: exported type VMModuleStub should have comment or be unexported (golint)
    • Line 14: warning: exported function NewVMModuleStub should have comment or be unexported (golint)
    • Line 25: warning: exported method VMModuleStub.Delete should have comment or be unexported (golint)
    • Line 38: warning: exported method VMModuleStub.Exists should have comment or be unexported (golint)
    • Line 50: warning: exported method VMModuleStub.Inspect should have comment or be unexported (golint)
    • Line 66: warning: exported method VMModuleStub.List should have comment or be unexported (golint)
    • Line 82: warning: exported method VMModuleStub.Logs should have comment or be unexported (golint)
    • Line 98: warning: exported method VMModuleStub.Run should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (signal: killed)


misspell97%

Misspell Finds commonly misspelled English words

    • zos/pkg/monitor.go
    • Line 81: warning: "monitord" is a misspelling of "monitored" (misspell)
    • Line 89: warning: "monitord" is a misspelling of "monitored" (misspell)