Preparing report...

Report for github.com/ysicing/ergo

A+    Excellent!    Found 65 issues across 83 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo96%

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.

    • ergo/cmd/cvm.go
    • Line 49: warning: cyclomatic complexity 17 of function (*CvmOption).Init() is high (> 15) (gocyclo)

golint21%

Golint is a linter for Go source code.

    • ergo/cmd/upgrade.go
    • Line 11: warning: exported type UpgradeCmd should have comment or be unexported (golint)
    • Line 27: warning: exported method UpgradeCmd.Run should have comment or be unexported (golint)
    • ergo/common/embed.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: comment on exported var DefaultTemplate should be of the form "DefaultTemplate ..." (golint)
    • ergo/pkg/ergo/plugin/list.go
    • Line 21: warning: exported var ValidPluginFilenamePrefixes should have comment or be unexported (golint)
    • Line 24: warning: exported type ListOptions should have comment or be unexported (golint)
    • Line 32: warning: exported method ListOptions.Complete should have comment or be unexported (golint)
    • Line 40: warning: exported method ListOptions.Run should have comment or be unexported (golint)
    • Line 116: warning: exported type CommandOverrideVerifier should have comment or be unexported (golint)
    • Line 121: warning: exported method CommandOverrideVerifier.Verify should have comment or be unexported (golint)
    • ergo/cmd/version.go
    • Line 11: warning: exported type VersionCmd should have comment or be unexported (golint)
    • Line 26: warning: exported method VersionCmd.Run should have comment or be unexported (golint)
    • ergo/pkg/ergo/service/list.go
    • Line 16: warning: exported var ValidPluginFilenamePrefixes should have comment or be unexported (golint)
    • Line 19: warning: exported method Option.List should have comment or be unexported (golint)
    • ergo/version/version.go
    • Line 23: warning: exported var UsageTpl should have comment or be unexported (golint)
    • Line 36: warning: exported var Version should have comment or be unexported (golint)
    • Line 47: warning: exported function PreCheckVersion should have comment or be unexported (golint)
    • Line 64: warning: exported function ShowVersion should have comment or be unexported (golint)
    • Line 96: warning: exported function Upgrade should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/dns.go
    • Line 14: warning: exported type Domain should have comment or be unexported (golint)
    • Line 19: warning: exported type DomainList should have comment or be unexported (golint)
    • ergo/pkg/ergo/service/show.go
    • Line 19: warning: exported type ListRemoteOptions should have comment or be unexported (golint)
    • Line 24: warning: exported method Option.Show should have comment or be unexported (golint)
    • ergo/pkg/ergo/codegen/init.go
    • Line 25: warning: exported var CodeType should have comment or be unexported (golint)
    • Line 39: warning: exported type CodeGen should have comment or be unexported (golint)
    • Line 43: warning: exported var Project should have comment or be unexported (golint)
    • Line 56: warning: exported method CodeGen.GoClone should have comment or be unexported (golint)
    • Line 103: warning: exported type Crds should have comment or be unexported (golint)
    • Line 123: warning: exported method CodeGen.GenCrds should have comment or be unexported (golint)
    • ergo/pkg/ergo/plugin/sync.go
    • Line 22: warning: exported type ListRemoteOptions should have comment or be unexported (golint)
    • Line 27: warning: exported method ListRemoteOptions.Run should have comment or be unexported (golint)
    • ergo/cmd/service.go
    • Line 33: warning: exported function NewCmdServiceDump should have comment or be unexported (golint)
    • Line 61: warning: exported function NewCmdServiceShow should have comment or be unexported (golint)
    • Line 77: warning: exported function NewCmdServiceInstall should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/dns/ali.go
    • Line 14: warning: exported type AliDNS should have comment or be unexported (golint)
    • Line 18: warning: exported function NewAliDNS should have comment or be unexported (golint)
    • Line 34: warning: exported type AliDomainRecordsResp should have comment or be unexported (golint)
    • Line 44: warning: exported type AliDomainRecord should have comment or be unexported (golint)
    • Line 57: warning: exported method AliDNS.DomainRecords should have comment or be unexported (golint)
    • Line 80: warning: exported method AliDNS.AddDomainRecord should have comment or be unexported (golint)
    • Line 95: warning: exported method AliDNS.UpdateDomainRecord should have comment or be unexported (golint)
    • ergo/cmd/code.go
    • Line 17: warning: exported type CodeOptions should have comment or be unexported (golint)
    • Line 35: warning: exported method CodeOptions.Init should have comment or be unexported (golint)
    • ergo/cmd/root.go
    • Line 31: warning: exported function Execute should have comment or be unexported (golint)
    • Line 102: warning: exported type PluginHandler should have comment or be unexported (golint)
    • Line 107: warning: exported function NewDefaultPluginHandler should have comment or be unexported (golint)
    • Line 113: warning: exported type DefaultPluginHandler should have comment or be unexported (golint)
    • Line 156: warning: exported function HandlePluginCommand should have comment or be unexported (golint)
    • ergo/pkg/ergo/service/types.go
    • Line 18: warning: exported type SFile should have comment or be unexported (golint)
    • Line 23: warning: exported type Service should have comment or be unexported (golint)
    • Line 33: warning: exported method Service.GetURL should have comment or be unexported (golint)
    • Line 57: warning: exported function LoadIndexFile should have comment or be unexported (golint)
    • ergo/pkg/util/ssh/types.go
    • Line 15: warning: exported type SSH should have comment or be unexported (golint)
    • Line 24: warning: exported function Md5FromLocal should have comment or be unexported (golint)
    • Line 38: warning: exported function Sha256FromLocal should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/provider.go
    • Line 6: warning: exported type ProviderType should have comment or be unexported (golint)
    • Line 8: warning: exported method ProviderType.Value should have comment or be unexported (golint)
    • Line 13: warning: exported const ProviderAliyun should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var CloudType should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/aliyun/option.go
    • Line 8: warning: exported type Option should have comment or be unexported (golint)
    • Line 10: warning: exported function WithAPI should have comment or be unexported (golint)
    • Line 17: warning: exported function WithRegion should have comment or be unexported (golint)
    • Line 23: warning: exported function WithLog should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/qcloud/option.go
    • Line 8: warning: exported type Option should have comment or be unexported (golint)
    • Line 10: warning: exported function WithAPI should have comment or be unexported (golint)
    • Line 17: warning: exported function WithRegion should have comment or be unexported (golint)
    • Line 23: warning: exported function WithLog should have comment or be unexported (golint)
    • ergo/common/func.go
    • Line 12: warning: exported function GetDefaultLogDir should have comment or be unexported (golint)
    • Line 17: warning: exported function GetDefaultComposeDir should have comment or be unexported (golint)
    • Line 22: warning: exported function GetDefaultTmpDir should have comment or be unexported (golint)
    • Line 27: warning: exported function GetDefaultDataDir should have comment or be unexported (golint)
    • Line 32: warning: exported function GetDefaultDumpDir should have comment or be unexported (golint)
    • Line 37: warning: exported function GetDefaultBinDir should have comment or be unexported (golint)
    • Line 42: warning: exported function GetDefaultCfgDir should have comment or be unexported (golint)
    • Line 47: warning: exported function GetDefaultRepoCfg should have comment or be unexported (golint)
    • Line 56: warning: exported function GetRepoIndexFileByName should have comment or be unexported (golint)
    • Line 60: warning: exported function GetLockfile should have comment or be unexported (golint)
    • ergo/cmd/cvm.go
    • Line 24: warning: exported type CvmOption should have comment or be unexported (golint)
    • Line 49: warning: exported method CvmOption.Init should have comment or be unexported (golint)
    • Line 85: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ergo/pkg/daemon/service/service.go
    • Line 22: warning: exported type ErgoService should have comment or be unexported (golint)
    • Line 28: warning: exported method ErgoService.Start should have comment or be unexported (golint)
    • Line 34: warning: exported method ErgoService.Stop should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/cr.go
    • Line 15: warning: exported type CR should have comment or be unexported (golint)
    • Line 30: warning: exported type Tag should have comment or be unexported (golint)
    • Line 41: warning: exported type CRList should have comment or be unexported (golint)
    • ergo/cmd/ops.go
    • Line 26: warning: exported type OPSCmd should have comment or be unexported (golint)
    • Line 31: warning: exported type NCCmd should have comment or be unexported (golint)
    • Line 40: warning: exported type ExecCmd should have comment or be unexported (golint)
    • Line 185: warning: exported method ExecCmd.Exec should have comment or be unexported (golint)
    • ergo/cmd/plugin.go
    • Line 30: warning: exported function NewCmdPluginListRemote should have comment or be unexported (golint)
    • Line 46: warning: exported function NewCmdPluginInstall should have comment or be unexported (golint)
    • ergo/pkg/ergo/ops/nc/nc.go
    • Line 26: warning: exported type Convert should have comment or be unexported (golint)
    • Line 68: warning: exported function RunNC should have comment or be unexported (golint)
    • Line 123: warning: exported function ListenPacket should have comment or be unexported (golint)
    • Line 147: warning: exported function Listen should have comment or be unexported (golint)
    • ergo/pkg/ergo/plugin/types.go
    • Line 16: warning: exported type PFile should have comment or be unexported (golint)
    • Line 21: warning: exported type Plugin should have comment or be unexported (golint)
    • Line 32: warning: exported type PUrl should have comment or be unexported (golint)
    • Line 39: warning: exported method PUrl.PluginURL should have comment or be unexported (golint)
    • Line 60: warning: exported function LoadIndexFile should have comment or be unexported (golint)
    • ergo/cmd/debian.go
    • Line 19: warning: exported type DebianCmd should have comment or be unexported (golint)
    • Line 76: warning: exported method DebianCmd.Init should have comment or be unexported (golint)
    • Line 94: warning: exported method DebianCmd.UpCore should have comment or be unexported (golint)
    • Line 111: warning: exported method DebianCmd.Apt should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/ecs/ali.go
    • Line 6: warning: exported type ECS should have comment or be unexported (golint)
    • Line 10: warning: exported method ECS.Reset should have comment or be unexported (golint)
    • Line 14: warning: exported method ECS.List should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/ecs.go
    • Line 9: warning: exported type EcsCloud should have comment or be unexported (golint)
    • Line 19: warning: exported type CreateOption should have comment or be unexported (golint)
    • Line 21: warning: exported type EcsOption should have comment or be unexported (golint)
    • Line 23: warning: exported type DestroyOption should have comment or be unexported (golint)
    • Line 27: warning: exported type SnapshotOption should have comment or be unexported (golint)
    • Line 31: warning: exported type StatusOption should have comment or be unexported (golint)
    • Line 35: warning: exported type HaltOption should have comment or be unexported (golint)
    • Line 39: warning: exported type UpOption should have comment or be unexported (golint)
    • Line 43: warning: exported type ListOption should have comment or be unexported (golint)
    • ergo/pkg/util/lock/lock.go
    • Line 18: warning: exported type LockFile should have comment or be unexported (golint)
    • Line 22: warning: exported type Installed should have comment or be unexported (golint)
    • Line 79: warning: exported function LoadFile should have comment or be unexported (golint)
    • ergo/pkg/ergo/repo/types.go
    • Line 18: warning: exported type File should have comment or be unexported (golint)
    • Line 23: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 30: warning: exported function LoadFile should have comment or be unexported (golint)
    • Line 114: warning: exported type Repo should have comment or be unexported (golint)
    • ergo/common/vars.go
    • Line 7: warning: exported const FileMode0755 should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported const DefaultLogDir should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported const PluginRepoRemoteMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported const K3sBinName should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported const KubeQPS should have comment (or a comment on this block) or be unexported (golint)
    • ergo/pkg/downloader/downloader.go
    • Line 23: warning: exported type Status should have comment or be unexported (golint)
    • Line 26: warning: exported const StatusUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type Result should have comment or be unexported (golint)
    • Line 36: warning: exported function Download should have comment or be unexported (golint)
    • Line 80: warning: exported function CopyLocal should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/ecs/qcloud.go
    • Line 17: warning: exported type CVM should have comment or be unexported (golint)
    • Line 52: warning: exported method CVM.Reset should have comment or be unexported (golint)
    • Line 88: warning: exported method CVM.List should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/lighthouse/qcloud.go
    • Line 17: warning: exported type Lighthouse should have comment or be unexported (golint)
    • Line 30: warning: exported method Lighthouse.Reset should have comment or be unexported (golint)
    • Line 73: warning: exported method Lighthouse.BindKey should have comment or be unexported (golint)
    • Line 102: warning: exported method Lighthouse.List should have comment or be unexported (golint)
    • ergo/pkg/util/ssh/scp.go
    • Line 43: warning: exported method SSH.Md5Sum should have comment or be unexported (golint)
    • Line 356: warning: exported method SSH.ValidateMd5sumLocalWithRemote should have comment or be unexported (golint)
    • ergo/cmd/ext.go
    • Line 33: warning: exported type ExtOptions should have comment or be unexported (golint)
    • Line 136: warning: exported type SyncCRResp should have comment or be unexported (golint)
    • Line 150: warning: exported type SyncLogResp should have comment or be unexported (golint)
    • ergo/pkg/ergo/cloud/config.go
    • Line 20: warning: exported type Secrets should have comment or be unexported (golint)
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • Line 31: warning: exported type Configs should have comment or be unexported (golint)
    • Line 36: warning: exported function LoadCloudConfigs should have comment or be unexported (golint)
    • Line 53: warning: exported method Configs.Add should have comment or be unexported (golint)
    • Line 58: warning: exported method Configs.Save should have comment or be unexported (golint)
    • ergo/pkg/ergo/debian/upcore.go
    • Line 17: warning: exported const UpgradeCore should have comment or be unexported (golint)
    • Line 91: warning: exported function RunWait should have comment or be unexported (golint)
    • Line 101: warning: exported function RunLocalShell should have comment or be unexported (golint)
    • Line 125: warning: exported const AddDebSource should have comment or be unexported (golint)
    • ergo/pkg/ergo/repo/repo.go
    • Line 25: warning: exported type RepoAddOption should have comment or be unexported (golint)
    • Line 33: warning: exported method RepoAddOption.Run should have comment or be unexported (golint)
    • Line 99: warning: exported type RepoDelOption should have comment or be unexported (golint)
    • Line 105: warning: exported method RepoDelOption.Run should have comment or be unexported (golint)
    • Line 132: warning: exported type RepoUpdateOption should have comment or be unexported (golint)
    • Line 138: warning: exported method RepoUpdateOption.Run should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!