Preparing report...

Report for github.com/Dataman-Cloud/swan

A+    Excellent!    Found 102 issues across 144 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!


gocyclo90%

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.

    • swan/types/compose.go
    • Line 430: warning: cyclomatic complexity 37 of function (*DockerService).parameters() is high (> 15) (gocyclo)
    • Line 177: warning: cyclomatic complexity 17 of function (ServiceGroup).Valid() is high (> 15) (gocyclo)
    • swan/api/app.go
    • Line 777: warning: cyclomatic complexity 39 of function (*Server).canaryUpdate() is high (> 15) (gocyclo)
    • Line 285: warning: cyclomatic complexity 27 of function (*Server).scaleApp() is high (> 15) (gocyclo)
    • Line 1020: warning: cyclomatic complexity 23 of function (*Server).rollback() is high (> 15) (gocyclo)
    • Line 1166: warning: cyclomatic complexity 21 of function (*Server).updateWeights() is high (> 15) (gocyclo)
    • Line 1598: warning: cyclomatic complexity 20 of function (*Server).rollbackTask() is high (> 15) (gocyclo)
    • Line 484: warning: cyclomatic complexity 19 of function (*Server).updateApp() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 16 of function (*Server).listApps() is high (> 15) (gocyclo)

golint33%

Golint is a linter for Go source code.

    • swan/store/zk/version.go
    • Line 11: warning: comment on exported method ZKStore.CreateVersion should be of the form "CreateVersion ..." (golint)
    • Line 23: warning: exported method ZKStore.GetVersion should have comment or be unexported (golint)
    • Line 41: warning: exported method ZKStore.DeleteVersion should have comment or be unexported (golint)
    • Line 47: warning: exported method ZKStore.ListVersions should have comment or be unexported (golint)
    • swan/types/sysinfo.go
    • Line 3: warning: exported type SysInfo should have comment or be unexported (golint)
    • Line 16: warning: exported type MemoryInfo should have comment or be unexported (golint)
    • Line 21: warning: exported type CPUInfo should have comment or be unexported (golint)
    • Line 27: warning: exported type ContainersInfo should have comment or be unexported (golint)
    • swan/utils/dfs/dfs.go
    • Line 5: warning: exported type DirectedCycle should have comment or be unexported (golint)
    • Line 12: warning: exported function NewDirectedCycle should have comment or be unexported (golint)
    • Line 50: warning: exported method DirectedCycle.Cycle should have comment or be unexported (golint)
    • Line 54: warning: exported type BfsData should have comment or be unexported (golint)
    • Line 61: warning: exported function NewBFS should have comment or be unexported (golint)
    • Line 95: warning: exported method BfsData.BfsOrder should have comment or be unexported (golint)
    • Line 99: warning: exported type DfsOrder should have comment or be unexported (golint)
    • Line 109: warning: exported function NewDfsOrder should have comment or be unexported (golint)
    • Line 143: warning: exported method DfsOrder.PostOrder should have comment or be unexported (golint)
    • swan/store/zk/compose-ng.go
    • Line 11: warning: exported method ZKStore.CreateComposeNG should have comment or be unexported (golint)
    • Line 21: warning: exported method ZKStore.UpdateComposeNG should have comment or be unexported (golint)
    • Line 35: warning: exported method ZKStore.GetComposeNG should have comment or be unexported (golint)
    • Line 64: warning: exported method ZKStore.ListComposesNG should have comment or be unexported (golint)
    • Line 92: warning: exported method ZKStore.DeleteComposeNG should have comment or be unexported (golint)
    • swan/utils/yaml.go
    • Line 1: warning: package comment should be of the form "Package utils ..." (golint)
    • Line 13: warning: exported function YamlServices should have comment or be unexported (golint)
    • swan/store/etcd/version.go
    • Line 11: warning: exported method EtcdStore.CreateVersion should have comment or be unexported (golint)
    • Line 22: warning: exported method EtcdStore.GetVersion should have comment or be unexported (golint)
    • Line 40: warning: exported method EtcdStore.DeleteVersion should have comment or be unexported (golint)
    • Line 46: warning: exported method EtcdStore.ListVersions should have comment or be unexported (golint)
    • swan/mole/config.go
    • Line 9: warning: exported var RoleMaster should have comment or be unexported (golint)
    • Line 13: warning: exported type Role should have comment or be unexported (golint)
    • Line 15: warning: exported type Config should have comment or be unexported (golint)
    • swan/agent/resolver/resolver.go
    • Line 20: warning: exported type Resolver should have comment or be unexported (golint)
    • Line 32: warning: exported function NewResolver should have comment or be unexported (golint)
    • Line 66: warning: exported method Resolver.Start should have comment or be unexported (golint)
    • Line 177: warning: exported method Resolver.Forward should have comment or be unexported (golint)
    • Line 199: warning: exported method Resolver.Upsert should have comment or be unexported (golint)
    • swan/api/app.go
    • Line 622: warning: receiver name s should be consistent with previous receiver name r for Server (golint)
    • Line 719: warning: receiver name s should be consistent with previous receiver name r for Server (golint)
    • Line 1776: warning: receiver name s should be consistent with previous receiver name r for Server (golint)
    • swan/mesos/filter/filter.go
    • Line 8: warning: exported type Filter should have comment or be unexported (golint)
    • Line 12: warning: exported type FilterOptions should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function ApplyFilters should be of the form "ApplyFilters ..." (golint)
    • swan/mesos/agent/offer.go
    • Line 9: warning: exported type Offer should have comment or be unexported (golint)
    • Line 30: warning: exported function NewOffer should have comment or be unexported (golint)
    • Line 91: warning: exported method Offer.GetId should have comment or be unexported (golint)
    • Line 95: warning: exported method Offer.GetCpus should have comment or be unexported (golint)
    • Line 99: warning: exported method Offer.GetMem should have comment or be unexported (golint)
    • Line 103: warning: exported method Offer.GetDisk should have comment or be unexported (golint)
    • Line 107: warning: exported method Offer.GetPorts should have comment or be unexported (golint)
    • Line 111: warning: exported method Offer.GetPortRange should have comment or be unexported (golint)
    • Line 121: warning: exported method Offer.GetAgentId should have comment or be unexported (golint)
    • Line 125: warning: exported method Offer.GetAttrs should have comment or be unexported (golint)
    • Line 129: warning: exported method Offer.GetHostname should have comment or be unexported (golint)
    • Line 133: warning: exported method Offer.MarshalJSON should have comment or be unexported (golint)
    • swan/cmd/flag.go
    • Line 7: warning: exported function FlagListenAddr should have comment or be unexported (golint)
    • Line 16: warning: exported function FlagAdvertiseAddr should have comment or be unexported (golint)
    • Line 25: warning: exported function FlagStoreType should have comment or be unexported (golint)
    • Line 34: warning: exported function FlagEtcdAddrs should have comment or be unexported (golint)
    • Line 42: warning: exported function FlagStrategy should have comment or be unexported (golint)
    • Line 51: warning: exported function FlagEnableCORS should have comment or be unexported (golint)
    • Line 59: warning: exported function FlagReconciliationInterval should have comment or be unexported (golint)
    • Line 68: warning: exported function FlagReconciliationStep should have comment or be unexported (golint)
    • Line 77: warning: exported function FlagReconciliationStepDelay should have comment or be unexported (golint)
    • Line 86: warning: exported function FlagHeartbeatTimeout should have comment or be unexported (golint)
    • Line 95: warning: exported function FlagMaxTasksPerOffer should have comment or be unexported (golint)
    • Line 104: warning: exported function FlagEnableCapabilityKilling should have comment or be unexported (golint)
    • Line 113: warning: exported function FlagEnableCheckPoint should have comment or be unexported (golint)
    • Line 122: warning: exported function FlagJoinAddrs should have comment or be unexported (golint)
    • Line 131: warning: comment on exported function FlagGatewayEnabled should be of the form "FlagGatewayEnabled ..." (golint)
    • Line 142: warning: exported function FlagGatewayAdvertiseIp should have comment or be unexported (golint)
    • Line 151: warning: exported function FlagGatewayListenAddr should have comment or be unexported (golint)
    • Line 160: warning: exported function FlagGatewayTLSListenAddr should have comment or be unexported (golint)
    • Line 169: warning: exported function FlagGatewayTLSCertFile should have comment or be unexported (golint)
    • Line 178: warning: exported function FlagGatewayTLSKeyFile should have comment or be unexported (golint)
    • Line 187: warning: comment on exported function FlagDNSEnabled should be of the form "FlagDNSEnabled ..." (golint)
    • Line 198: warning: exported function FlagDNSListenAddr should have comment or be unexported (golint)
    • Line 207: warning: exported function FlagDNSTTL should have comment or be unexported (golint)
    • Line 216: warning: exported function FlagDNSResolvers should have comment or be unexported (golint)
    • Line 225: warning: exported function FlagMesosURL should have comment or be unexported (golint)
    • Line 233: warning: exported function FlagZKURL should have comment or be unexported (golint)
    • Line 241: warning: exported function FlagLogLevel should have comment or be unexported (golint)
    • Line 250: warning: exported function FlagDomain should have comment or be unexported (golint)
    • Line 259: warning: comment on exported function FlagIPAMEnabled should be of the form "FlagIPAMEnabled ..." (golint)
    • Line 270: warning: exported function FlagIPAMStoreType should have comment or be unexported (golint)
    • Line 278: warning: exported function FlagIPAMEtcdAddrs should have comment or be unexported (golint)
    • Line 286: warning: exported function FlagIPAMZKAddrs should have comment or be unexported (golint)
    • Line 294: warning: comment on exported function FlagIPAMIPStart should be of the form "FlagIPAMIPStart ..." (golint)
    • Line 303: warning: exported function FlagIPAMIPEnd should have comment or be unexported (golint)
    • swan/agent/janitor/janitor.go
    • Line 24: warning: exported type JanitorServer should have comment or be unexported (golint)
    • Line 32: warning: exported function NewJanitorServer should have comment or be unexported (golint)
    • Line 53: warning: exported method JanitorServer.Start should have comment or be unexported (golint)
    • Line 73: warning: exported method JanitorServer.UpsertBackend should have comment or be unexported (golint)
    • swan/mesos/task.go
    • Line 11: warning: comment on exported type Task should be of the form "Task ..." (with optional leading article) (golint)
    • Line 20: warning: exported function NewTask should have comment or be unexported (golint)
    • Line 32: warning: exported method Task.ID should have comment or be unexported (golint)
    • Line 36: warning: exported method Task.Build should have comment or be unexported (golint)
    • Line 74: warning: exported function DetectTaskError should have comment or be unexported (golint)
    • swan/mole/protocol.go
    • Line 12: warning: exported var HEADER should have comment or be unexported (golint)
    • Line 46: warning: exported function Encode should have comment or be unexported (golint)
    • Line 61: warning: exported type Decoder should have comment or be unexported (golint)
    • Line 74: warning: exported method Decoder.Buffered should have comment or be unexported (golint)
    • swan/agent/agent.go
    • Line 25: warning: exported type Agent should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 74: warning: exported method Agent.StartAndJoin should have comment or be unexported (golint)
    • Line 164: warning: exported method Agent.Join should have comment or be unexported (golint)
    • Line 187: warning: exported method Agent.NewListener should have comment or be unexported (golint)
    • Line 191: warning: exported method Agent.ServeProtocol should have comment or be unexported (golint)
    • Line 195: warning: exported method Agent.ServeApi should have comment or be unexported (golint)
    • swan/version/version.go
    • Line 16: warning: exported type Version should have comment or be unexported (golint)
    • Line 25: warning: exported function GetVersion should have comment or be unexported (golint)
    • Line 43: warning: exported function TextFormatTo should have comment or be unexported (golint)
    • swan/store/store.go
    • Line 12: warning: exported type Store should have comment or be unexported (golint)
    • Line 51: warning: exported function Setup should have comment or be unexported (golint)
    • swan/agent/janitor/upstream/upstream.go
    • Line 18: warning: comment on exported type UpsManager should be of the form "UpsManager ..." (with optional leading article) (golint)
    • Line 25: warning: exported type Upstream should have comment or be unexported (golint)
    • Line 89: warning: comment on exported type Backend should be of the form "Backend ..." (with optional leading article) (golint)
    • Line 121: warning: exported method Backend.Addr should have comment or be unexported (golint)
    • Line 125: warning: comment on exported type BackendCombined should be of the form "BackendCombined ..." (with optional leading article) (golint)
    • Line 135: warning: exported method BackendCombined.Valid should have comment or be unexported (golint)
    • Line 151: warning: exported method BackendCombined.Format should have comment or be unexported (golint)
    • Line 162: warning: comment on exported function AllUpstreams should be of the form "AllUpstreams ..." (golint)
    • Line 170: warning: exported function AllSessions should have comment or be unexported (golint)
    • Line 181: warning: exported function GetUpstream should have comment or be unexported (golint)
    • Line 189: warning: exported function UpsertBackend should have comment or be unexported (golint)
    • Line 241: warning: exported function GetBackend should have comment or be unexported (golint)
    • Line 249: warning: exported function RemoveBackend should have comment or be unexported (golint)
    • Line 282: warning: comment on exported function LookupAlias should be of the form "LookupAlias ..." (golint)
    • Line 295: warning: comment on exported function LookupListen should be of the form "LookupListen ..." (golint)
    • Line 308: warning: exported function LookupUpstream should have comment or be unexported (golint)
    • Line 325: warning: comment on exported function Lookup should be of the form "Lookup ..." (golint)
    • swan/agent/janitor/api.go
    • Line 13: warning: exported method JanitorServer.ListUpstreams should have comment or be unexported (golint)
    • Line 18: warning: exported method JanitorServer.GetUpstream should have comment or be unexported (golint)
    • Line 35: warning: exported method JanitorServer.UpsertUpstream should have comment or be unexported (golint)
    • Line 55: warning: exported method JanitorServer.DelUpstream should have comment or be unexported (golint)
    • Line 66: warning: exported method JanitorServer.ListSessions should have comment or be unexported (golint)
    • Line 71: warning: exported method JanitorServer.ShowConfigs should have comment or be unexported (golint)
    • Line 76: warning: exported method JanitorServer.ShowStats should have comment or be unexported (golint)
    • Line 87: warning: exported method JanitorServer.ShowUpstreamStats should have comment or be unexported (golint)
    • Line 98: warning: exported method JanitorServer.ShowBackendStats should have comment or be unexported (golint)
    • swan/mesos/cluster.go
    • Line 19: warning: exported method Scheduler.ClusterAgents should have comment or be unexported (golint)
    • Line 23: warning: exported method Scheduler.ClusterAgent should have comment or be unexported (golint)
    • Line 27: warning: exported method Scheduler.CloseClusterAgent should have comment or be unexported (golint)
    • swan/api/route.go
    • Line 8: warning: exported type HandlerFunc should have comment or be unexported (golint)
    • Line 10: warning: exported type Route should have comment or be unexported (golint)
    • Line 17: warning: exported method Route.Methods should have comment or be unexported (golint)
    • Line 24: warning: exported method Route.Path should have comment or be unexported (golint)
    • Line 28: warning: exported method Route.Handler should have comment or be unexported (golint)
    • Line 32: warning: exported function NewRoute should have comment or be unexported (golint)
    • Line 41: warning: exported function NewPrefixRoute should have comment or be unexported (golint)
    • swan/store/zk/application.go
    • Line 14: warning: exported method ZKStore.CreateApp should have comment or be unexported (golint)
    • Line 37: warning: comment on exported method ZKStore.UpdateApp should be of the form "UpdateApp ..." (golint)
    • Line 49: warning: exported method ZKStore.GetApp should have comment or be unexported (golint)
    • Line 100: warning: exported method ZKStore.GetAppOpStatus should have comment or be unexported (golint)
    • Line 117: warning: exported method ZKStore.ListApps should have comment or be unexported (golint)
    • Line 137: warning: exported method ZKStore.DeleteApp should have comment or be unexported (golint)
    • swan/agent/janitor/stats/counter.go
    • Line 58: warning: exported type GlobalCounterAlias should have comment or be unexported (golint)
    • Line 60: warning: exported method GlobalCounter.MarshalJSON should have comment or be unexported (golint)
    • Line 94: warning: exported type BackendCounterAlias should have comment or be unexported (golint)
    • Line 96: warning: exported method BackendCounter.MarshalJSON should have comment or be unexported (golint)
    • Line 107: warning: exported type DeltaBackend should have comment or be unexported (golint)
    • Line 116: warning: exported type DeltaGlb should have comment or be unexported (golint)
    • Line 123: warning: exported function Get should have comment or be unexported (golint)
    • Line 130: warning: exported function UpstreamStats should have comment or be unexported (golint)
    • Line 135: warning: exported function Incr should have comment or be unexported (golint)
    • Line 144: warning: exported function Del should have comment or be unexported (golint)
    • swan/store/etcd/application.go
    • Line 13: warning: exported method EtcdStore.CreateApp should have comment or be unexported (golint)
    • Line 46: warning: exported method EtcdStore.UpdateApp should have comment or be unexported (golint)
    • Line 60: warning: exported method EtcdStore.GetApp should have comment or be unexported (golint)
    • Line 109: warning: exported method EtcdStore.GetAppOpStatus should have comment or be unexported (golint)
    • Line 129: warning: exported method EtcdStore.ListApps should have comment or be unexported (golint)
    • Line 149: warning: exported method EtcdStore.DeleteApp should have comment or be unexported (golint)
    • swan/store/etcd/compose.go
    • Line 9: warning: exported method EtcdStore.CreateCompose should have comment or be unexported (golint)
    • Line 19: warning: exported method EtcdStore.UpdateCompose should have comment or be unexported (golint)
    • Line 33: warning: exported method EtcdStore.GetCompose should have comment or be unexported (golint)
    • Line 59: warning: exported method EtcdStore.ListComposes should have comment or be unexported (golint)
    • Line 87: warning: exported method EtcdStore.DeleteCompose should have comment or be unexported (golint)
    • swan/types/app.go
    • Line 11: warning: exported const OpStatusNoop should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type Application should have comment or be unexported (golint)
    • Line 44: warning: exported type AppFilterOptions should have comment or be unexported (golint)
    • Line 49: warning: exported type Health should have comment or be unexported (golint)
    • swan/types/constraints.go
    • Line 11: warning: exported type Constraint should have comment or be unexported (golint)
    • Line 30: warning: exported method Constraint.Match should have comment or be unexported (golint)
    • swan/types/version.go
    • Line 17: warning: comment on exported const UpdateStop should be of the form "UpdateStop ..." (golint)
    • Line 19: warning: exported const UpdateContinue should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type VersionList should have comment or be unexported (golint)
    • Line 34: warning: exported method VersionList.Sort should have comment or be unexported (golint)
    • Line 38: warning: exported method VersionList.Reverse should have comment or be unexported (golint)
    • Line 42: warning: exported type Version should have comment or be unexported (golint)
    • Line 66: warning: exported type Container should have comment or be unexported (golint)
    • Line 72: warning: exported method Container.Valid should have comment or be unexported (golint)
    • Line 87: warning: exported type Docker should have comment or be unexported (golint)
    • Line 96: warning: exported method Docker.Valid should have comment or be unexported (golint)
    • Line 121: warning: exported type Parameter should have comment or be unexported (golint)
    • Line 126: warning: exported method Parameter.Valid should have comment or be unexported (golint)
    • Line 133: warning: exported type PortMapping should have comment or be unexported (golint)
    • Line 140: warning: exported method PortMapping.Valid should have comment or be unexported (golint)
    • Line 156: warning: exported type Volume should have comment or be unexported (golint)
    • Line 162: warning: exported method Volume.Valid should have comment or be unexported (golint)
    • Line 174: warning: exported type KillPolicy should have comment or be unexported (golint)
    • Line 178: warning: exported method KillPolicy.Valid should have comment or be unexported (golint)
    • Line 185: warning: exported type RestartPolicy should have comment or be unexported (golint)
    • Line 189: warning: exported method RestartPolicy.Valid should have comment or be unexported (golint)
    • Line 196: warning: exported type UpdatePolicy should have comment or be unexported (golint)
    • Line 201: warning: exported method UpdatePolicy.Valid should have comment or be unexported (golint)
    • Line 213: warning: exported type HealthCheck should have comment or be unexported (golint)
    • Line 225: warning: exported method HealthCheck.Valid should have comment or be unexported (golint)
    • Line 267: warning: exported type Proxy should have comment or be unexported (golint)
    • Line 272: warning: exported type ProxyItem should have comment or be unexported (golint)
    • Line 278: warning: comment on exported type ProxyAlias should be of the form "ProxyAlias ..." (with optional leading article) (golint)
    • Line 286: warning: exported method Proxy.Valid should have comment or be unexported (golint)
    • Line 343: warning: exported method Version.IsHealthSet should have comment or be unexported (golint)
    • Line 364: warning: exported method Version.Validate should have comment or be unexported (golint)
    • swan/mole/master.go
    • Line 14: warning: exported type Master should have comment or be unexported (golint)
    • Line 22: warning: exported function NewMaster should have comment or be unexported (golint)
    • Line 31: warning: exported method Master.Serve should have comment or be unexported (golint)
    • Line 84: warning: exported method Master.AddAgent should have comment or be unexported (golint)
    • Line 103: warning: exported method Master.CloseAllAgents should have comment or be unexported (golint)
    • Line 109: warning: exported method Master.CloseAgent should have comment or be unexported (golint)
    • Line 118: warning: exported method Master.FreshAgent should have comment or be unexported (golint)
    • Line 126: warning: comment on exported method Master.Agent should be of the form "Agent ..." (golint)
    • Line 134: warning: exported method Master.Agents should have comment or be unexported (golint)
    • Line 149: warning: exported method ClusterAgent.ID should have comment or be unexported (golint)
    • swan/agent/ipam/subnet.go
    • Line 10: warning: comment on exported type SubNet should be of the form "SubNet ..." (with optional leading article) (golint)
    • Line 21: warning: exported function NewSubNet should have comment or be unexported (golint)
    • Line 41: warning: comment on exported type IPPoolRange should be of the form "IPPoolRange ..." (with optional leading article) (golint)
    • Line 48: warning: exported method IPPoolRange.SubNetID should have comment or be unexported (golint)
    • Line 57: warning: exported method IPPoolRange.IPList should have comment or be unexported (golint)
    • Line 70: warning: exported method IPPoolRange.Valid should have comment or be unexported (golint)
    • swan/api/server.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 23: warning: exported type Server should have comment or be unexported (golint)
    • Line 34: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 95: warning: exported method Server.Run should have comment or be unexported (golint)
    • Line 99: warning: comment on exported method Server.Shutdown should be of the form "Shutdown ..." (golint)
    • Line 110: warning: exported method Server.Stop should have comment or be unexported (golint)
    • Line 118: warning: exported method Server.Reload should have comment or be unexported (golint)
    • Line 141: warning: exported method Server.UpdateLeader should have comment or be unexported (golint)
    • Line 148: warning: exported method Server.GetLeader should have comment or be unexported (golint)
    • swan/manager/zk_HA.go
    • Line 14: warning: exported type Leadership should have comment or be unexported (golint)
    • Line 17: warning: exported const ZKFlagNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var ZKDefaultACL should have comment or be unexported (golint)
    • Line 81: warning: error should be the last type when returning multiple items (golint)
    • swan/config/manager.go
    • Line 12: warning: exported type ManagerConfig should have comment or be unexported (golint)
    • Line 35: warning: exported function NewManagerConfig should have comment or be unexported (golint)
    • swan/agent/janitor/upstream/sessions.go
    • Line 11: warning: comment on exported type Sessions should be of the form "Sessions ..." (with optional leading article) (golint)
    • Line 37: warning: exported method Sessions.MarshalJSON should have comment or be unexported (golint)
    • swan/store/etcd/framework.go
    • Line 5: warning: exported method EtcdStore.UpdateFrameworkId should have comment or be unexported (golint)
    • Line 9: warning: exported method EtcdStore.GetFrameworkId should have comment or be unexported (golint)
    • swan/types/task.go
    • Line 15: warning: exported const TaskHealthyUnset should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type Task should have comment or be unexported (golint)
    • Line 41: warning: exported type TaskList should have comment or be unexported (golint)
    • Line 52: warning: exported method TaskList.Reverse should have comment or be unexported (golint)
    • Line 56: warning: exported method TaskList.Sort should have comment or be unexported (golint)
    • Line 60: warning: exported type TaskConfig should have comment or be unexported (golint)
    • Line 86: warning: exported function NewTaskConfig should have comment or be unexported (golint)
    • Line 140: warning: exported method TaskConfig.ResourcesRequired should have comment or be unexported (golint)
    • Line 150: warning: exported method TaskConfig.BuildCommand should have comment or be unexported (golint)
    • Line 302: warning: exported method TaskConfig.BuildContainer should have comment or be unexported (golint)
    • Line 324: warning: exported method TaskConfig.BuildResources should have comment or be unexported (golint)
    • Line 411: warning: exported method TaskConfig.BuildHealthCheck should have comment or be unexported (golint)
    • Line 470: warning: exported method TaskConfig.BuildLabels should have comment or be unexported (golint)
    • Line 523: warning: exported type TaskSorter should have comment or be unexported (golint)
    • Line 534: warning: exported method Task.Index should have comment or be unexported (golint)
    • swan/store/zk/compose.go
    • Line 12: warning: exported method ZKStore.CreateCompose should have comment or be unexported (golint)
    • Line 22: warning: exported method ZKStore.UpdateCompose should have comment or be unexported (golint)
    • Line 36: warning: exported method ZKStore.GetCompose should have comment or be unexported (golint)
    • Line 65: warning: exported method ZKStore.ListComposes should have comment or be unexported (golint)
    • Line 93: warning: exported method ZKStore.DeleteCompose should have comment or be unexported (golint)
    • swan/store/etcd/compose-ng.go
    • Line 9: warning: exported method EtcdStore.CreateComposeNG should have comment or be unexported (golint)
    • Line 19: warning: exported method EtcdStore.UpdateComposeNG should have comment or be unexported (golint)
    • Line 33: warning: exported method EtcdStore.GetComposeNG should have comment or be unexported (golint)
    • Line 59: warning: exported method EtcdStore.ListComposesNG should have comment or be unexported (golint)
    • Line 87: warning: exported method EtcdStore.DeleteComposeNG should have comment or be unexported (golint)
    • swan/types/event.go
    • Line 12: warning: exported const EventTypeTaskHealthy should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type CombinedEvents should have comment or be unexported (golint)
    • Line 23: warning: exported type TaskEvent should have comment or be unexported (golint)
    • swan/mole/agent.go
    • Line 18: warning: exported var FILE_UUID should have comment or be unexported (golint)
    • Line 24: warning: exported type ConnHandler should have comment or be unexported (golint)
    • Line 28: warning: exported type Agent should have comment or be unexported (golint)
    • Line 35: warning: exported function NewAgent should have comment or be unexported (golint)
    • Line 64: warning: exported method Agent.Join should have comment or be unexported (golint)
    • Line 86: warning: exported method Agent.ServeProtocol should have comment or be unexported (golint)
    • Line 138: warning: exported method Agent.NewListener should have comment or be unexported (golint)
    • Line 146: warning: exported type AgentListener should have comment or be unexported (golint)
    • Line 152: warning: comment on exported method AgentListener.Accept should be of the form "Accept ..." (golint)
    • Line 162: warning: exported method AgentListener.Close should have comment or be unexported (golint)
    • Line 172: warning: exported method AgentListener.Addr should have comment or be unexported (golint)
    • Line 176: warning: comment on exported method AgentListener.HandleWorkerConn should be of the form "HandleWorkerConn ..." (golint)
    • swan/agent/ipam/api.go
    • Line 8: warning: exported method IPAM.ListSubNets should have comment or be unexported (golint)
    • Line 37: warning: exported method IPAM.SetSubNetPool should have comment or be unexported (golint)
    • swan/mesos/agent/agent.go
    • Line 10: warning: exported type Agent should have comment or be unexported (golint)
    • Line 19: warning: exported function NewAgent should have comment or be unexported (golint)
    • Line 28: warning: exported method Agent.MarshalJSON should have comment or be unexported (golint)
    • Line 41: warning: exported method Agent.ID should have comment or be unexported (golint)
    • Line 45: warning: exported method Agent.AddOffer should have comment or be unexported (golint)
    • Line 51: warning: exported method Agent.RemoveOffer should have comment or be unexported (golint)
    • Line 62: warning: exported method Agent.Empty should have comment or be unexported (golint)
    • Line 69: warning: exported method Agent.GetOffer should have comment or be unexported (golint)
    • Line 81: warning: exported method Agent.GetOffers should have comment or be unexported (golint)
    • Line 93: warning: exported method Agent.Resources should have comment or be unexported (golint)
    • Line 104: warning: exported method Agent.Attributes should have comment or be unexported (golint)
    • swan/cmd/manager.go
    • Line 12: warning: exported function ManagerCmd should have comment or be unexported (golint)
    • Line 42: warning: exported function StartManager should have comment or be unexported (golint)
    • swan/store/zk/zk.go
    • Line 34: warning: exported type ZKStore should have comment or be unexported (golint)
    • Line 40: warning: exported function DB should have comment or be unexported (golint)
    • Line 44: warning: exported function NewZKStore should have comment or be unexported (golint)
    • Line 64: warning: exported method ZKStore.IsErrNotFound should have comment or be unexported (golint)
    • swan/utils/selection/validation.go
    • Line 54: warning: exported const LabelValueMaxLength should have comment or be unexported (golint)
    • Line 73: warning: exported const DNS1123LabelMaxLength should have comment or be unexported (golint)
    • Line 91: warning: exported const DNS1123SubdomainMaxLength should have comment or be unexported (golint)
    • Line 109: warning: exported const DNS1035LabelMaxLength should have comment or be unexported (golint)
    • Line 235: warning: exported function IsValidPercent should have comment or be unexported (golint)
    • swan/utils/strings.go
    • Line 16: warning: exported function StripSpaces should have comment or be unexported (golint)
    • Line 27: warning: exported function LegalDomain should have comment or be unexported (golint)
    • Line 37: warning: exported function RandomString should have comment or be unexported (golint)
    • swan/types/canary.go
    • Line 4: warning: exported const DefaultCanaryUpdateDelay should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: exported type CanaryUpdateBody should have comment or be unexported (golint)
    • swan/types/compose-ng.go
    • Line 17: warning: exported var DefaultDeployConfig should have comment or be unexported (golint)
    • Line 22: warning: comment on exported type ComposeAppSorter should be of the form "ComposeAppSorter ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported type ComposeAppWrapper should be of the form "ComposeAppWrapper ..." (with optional leading article) (golint)
    • Line 59: warning: exported method ComposeApp.Valid should have comment or be unexported (golint)
    • Line 78: warning: exported function ParseComposeV3 should have comment or be unexported (golint)
    • Line 117: warning: exported method ComposeApp.ParseComposeToVersions should have comment or be unexported (golint)
    • Line 179: warning: exported type ComposeV3Alias should have comment or be unexported (golint)
    • Line 181: warning: exported method ComposeV3.UnmarshalYAML should have comment or be unexported (golint)
    • Line 194: warning: exported method ComposeV3.GetServices should have comment or be unexported (golint)
    • Line 202: warning: exported method ComposeV3.GetVariables should have comment or be unexported (golint)
    • Line 206: warning: exported method ComposeV3.Valid should have comment or be unexported (golint)
    • Line 259: warning: exported method ComposeV3.Circled should have comment or be unexported (golint)
    • Line 271: warning: exported method ComposeV3.PrioritySort should have comment or be unexported (golint)
    • Line 280: warning: exported method ComposeV3.DependMap should have comment or be unexported (golint)
    • Line 294: warning: comment on exported method ComposeV3.ConvertServiceToVersion should be of the form "ConvertServiceToVersion ..." (golint)
    • Line 439: warning: exported method ComposeService.Valid should have comment or be unexported (golint)
    • Line 682: warning: exported type LoggingConfig should have comment or be unexported (golint)
    • Line 687: warning: exported type DeployConfig should have comment or be unexported (golint)
    • Line 693: warning: exported type HealthCheckConfig should have comment or be unexported (golint)
    • Line 710: warning: exported type UlimitAlias should have comment or be unexported (golint)
    • Line 712: warning: exported method Ulimit.UnmarshalYAML should have comment or be unexported (golint)
    • Line 734: warning: exported method StrSlice.UnmarshalYAML should have comment or be unexported (golint)
    • Line 751: warning: comment on exported type SliceMap should be of the form "SliceMap ..." (with optional leading article) (golint)
    • Line 754: warning: exported method SliceMap.UnmarshalYAML should have comment or be unexported (golint)
    • swan/agent/ipam/ipam.go
    • Line 18: warning: exported type IPAM should have comment or be unexported (golint)
    • Line 23: warning: exported function New should have comment or be unexported (golint)
    • Line 29: warning: exported method IPAM.Serve should have comment or be unexported (golint)
    • Line 54: warning: exported method IPAM.SetIPPool should have comment or be unexported (golint)
    • Line 179: warning: exported method IPAM.ReleaseAddress should have comment or be unexported (golint)
    • swan/cmd/main.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported function Main should have comment or be unexported (golint)
    • swan/store/etcd/etcd.go
    • Line 37: warning: exported type EtcdStore should have comment or be unexported (golint)
    • Line 43: warning: exported function NewEtcdStore should have comment or be unexported (golint)
    • Line 190: warning: exported type EtcdClusterInfo should have comment or be unexported (golint)
    • Line 195: warning: exported type MemberWrapper should have comment or be unexported (golint)
    • Line 202: warning: exported method EtcdStore.IsErrNotFound should have comment or be unexported (golint)
    • Line 214: warning: exported method EtcdStore.ClusterInfo should have comment or be unexported (golint)
    • swan/store/etcd/task.go
    • Line 12: warning: exported method EtcdStore.CreateTask should have comment or be unexported (golint)
    • Line 23: warning: exported method EtcdStore.UpdateTask should have comment or be unexported (golint)
    • Line 34: warning: exported method EtcdStore.ListTaskHistory should have comment or be unexported (golint)
    • Line 38: warning: exported method EtcdStore.ListTasks should have comment or be unexported (golint)
    • Line 68: warning: exported method EtcdStore.DeleteTask should have comment or be unexported (golint)
    • Line 77: warning: exported method EtcdStore.GetTask should have comment or be unexported (golint)
    • swan/types/compose.go
    • Line 1: warning: package comment should be of the form "Package types ..." (golint)
    • Line 27: warning: comment on exported type ComposeSorter should be of the form "ComposeSorter ..." (with optional leading article) (golint)
    • Line 34: warning: comment on exported type ComposeWrapper should be of the form "ComposeWrapper ..." (with optional leading article) (golint)
    • Line 40: warning: comment on exported type Compose should be of the form "Compose ..." (with optional leading article) (golint)
    • Line 61: warning: exported method Compose.Valid should have comment or be unexported (golint)
    • Line 72: warning: exported method Compose.RequireConvert should have comment or be unexported (golint)
    • Line 76: warning: exported method Compose.RunAs should have comment or be unexported (golint)
    • Line 85: warning: exported method Compose.Cluster should have comment or be unexported (golint)
    • Line 94: warning: comment on exported method Compose.ToServiceGroup should be of the form "ToServiceGroup ..." (golint)
    • Line 150: warning: comment on exported type YamlExtra should be of the form "YamlExtra ..." (with optional leading article) (golint)
    • Line 165: warning: exported type Resource should have comment or be unexported (golint)
    • Line 177: warning: exported method ServiceGroup.Valid should have comment or be unexported (golint)
    • Line 252: warning: exported method ServiceGroup.PrioritySort should have comment or be unexported (golint)
    • Line 261: warning: exported method ServiceGroup.DependMap should have comment or be unexported (golint)
    • Line 286: warning: exported method DockerService.Valid should have comment or be unexported (golint)
    • Line 293: warning: comment on exported method DockerService.ToVersion should be of the form "ToVersion ..." (golint)
    • swan/mesos/framework.go
    • Line 12: warning: exported const DefaultFrameworkFailoverTimeout should have comment or be unexported (golint)
    • Line 50: warning: exported method Scheduler.FrameworkInfo should have comment or be unexported (golint)
    • swan/mesos/scheduler.go
    • Line 28: warning: exported type SchedulerConfig should have comment or be unexported (golint)
    • Line 75: warning: comment on exported function NewScheduler should be of the form "NewScheduler ..." (golint)
    • Line 145: warning: comment on exported method Scheduler.ClusterName should be of the form "ClusterName ..." (golint)
    • Line 150: warning: exported method Scheduler.FrameworkId should have comment or be unexported (golint)
    • Line 229: warning: exported method Scheduler.Unsubscribe should have comment or be unexported (golint)
    • Line 464: warning: exported method Scheduler.KillTask should have comment or be unexported (golint)
    • Line 548: warning: exported method Scheduler.AckUpdateEvent should have comment or be unexported (golint)
    • Line 568: warning: exported method Scheduler.SubscribeEvent should have comment or be unexported (golint)
    • Line 666: warning: exported method Scheduler.Dump should have comment or be unexported (golint)
    • Line 678: warning: exported method Scheduler.Offers should have comment or be unexported (golint)
    • Line 713: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 752: warning: exported method Scheduler.LaunchTasks should have comment or be unexported (golint)
    • Line 1009: warning: exported method Scheduler.Load should have comment or be unexported (golint)
    • Line 1107: warning: exported method Scheduler.SendEvent should have comment or be unexported (golint)
    • swan/agent/janitor/proxy/http_proxy.go
    • Line 19: warning: comment on exported type HTTPProxy should be of the form "HTTPProxy ..." (with optional leading article) (golint)
    • Line 24: warning: exported function NewHTTPProxyHandler should have comment or be unexported (golint)
    • swan/utils/fields/selector.go
    • Line 229: warning: comment on exported function ParseAndTransformSelector should be of the form "ParseAndTransformSelector ..." (golint)
    • Line 234: warning: comment on exported type TransformFunc should be of the form "TransformFunc ..." (with optional leading article) (golint)
    • swan/cmd/agent.go
    • Line 13: warning: exported function AgentCmd should have comment or be unexported (golint)
    • Line 49: warning: exported function AgentIPAMIPPoolCmd should have comment or be unexported (golint)
    • Line 62: warning: exported function JoinAndStartAgent should have comment or be unexported (golint)
    • Line 74: warning: exported function IPAMSetIPPool should have comment or be unexported (golint)
    • swan/store/zk/framework.go
    • Line 5: warning: exported method ZKStore.UpdateFrameworkId should have comment or be unexported (golint)
    • Line 9: warning: exported method ZKStore.GetFrameworkId should have comment or be unexported (golint)
    • swan/utils/labels/selector.go
    • Line 46: warning: exported function NewSelector should have comment or be unexported (golint)
    • Line 50: warning: exported type ByKey should have comment or be unexported (golint)
    • Line 198: warning: exported method Requirement.Key should have comment or be unexported (golint)
    • Line 202: warning: exported method Requirement.Operator should have comment or be unexported (golint)
    • Line 206: warning: exported method Requirement.Values should have comment or be unexported (golint)
    • Line 316: warning: comment on exported type Token should be of the form "Token ..." (with optional leading article) (golint)
    • Line 320: warning: exported const ErrorToken should have comment (or a comment on this block) or be unexported (golint)
    • Line 352: warning: comment on exported type ScannedItem should be of the form "ScannedItem ..." (with optional leading article) (golint)
    • Line 481: warning: comment on exported type ParserContext should be of the form "ParserContext ..." (with optional leading article) (golint)
    • Line 488: warning: exported const KeyAndOperator should have comment (or a comment on this block) or be unexported (golint)
    • Line 588: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 801: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • swan/mesos/httpclient.go
    • Line 12: warning: exported const HttpTimeoutDuration should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function NewHTTPClient should have comment or be unexported (golint)
    • swan/agent/janitor/proxy/tcp_proxy.go
    • Line 17: warning: comment on exported type TCPProxyServer should be of the form "TCPProxyServer ..." (with optional leading article) (golint)
    • Line 29: warning: exported function NewTCPProxyServer should have comment or be unexported (golint)
    • Line 36: warning: exported method TCPProxyServer.MarshalJSON should have comment or be unexported (golint)
    • Line 50: warning: exported method TCPProxyServer.Listen should have comment or be unexported (golint)
    • Line 62: warning: exported method TCPProxyServer.Serve should have comment or be unexported (golint)
    • Line 79: warning: exported method TCPProxyServer.Stop should have comment or be unexported (golint)
    • swan/agent/resolver/api.go
    • Line 10: warning: exported method Resolver.ListRecords should have comment or be unexported (golint)
    • Line 15: warning: exported method Resolver.GetRecord should have comment or be unexported (golint)
    • Line 29: warning: exported method Resolver.UpsertRecord should have comment or be unexported (golint)
    • Line 45: warning: exported method Resolver.DelRecord should have comment or be unexported (golint)
    • Line 58: warning: exported method Resolver.ShowConfigs should have comment or be unexported (golint)
    • Line 63: warning: exported method Resolver.ShowStats should have comment or be unexported (golint)
    • Line 68: warning: exported method Resolver.ShowParentStats should have comment or be unexported (golint)
    • swan/agent/resolver/stats.go
    • Line 9: warning: exported type Stats should have comment or be unexported (golint)
    • Line 17: warning: exported type StatsAlias should have comment or be unexported (golint)
    • Line 19: warning: exported type Counter should have comment or be unexported (golint)
    • Line 36: warning: exported method Stats.MarshalJSON should have comment or be unexported (golint)
    • Line 47: warning: exported method Stats.Get should have comment or be unexported (golint)
    • Line 53: warning: exported method Stats.Incr should have comment or be unexported (golint)
    • Line 82: warning: exported method Stats.Del should have comment or be unexported (golint)
    • swan/store/zk/task.go
    • Line 13: warning: exported method ZKStore.CreateTask should have comment or be unexported (golint)
    • Line 24: warning: exported method ZKStore.UpdateTask should have comment or be unexported (golint)
    • Line 35: warning: exported method ZKStore.ListTaskHistory should have comment or be unexported (golint)
    • Line 39: warning: exported method ZKStore.ListTasks should have comment or be unexported (golint)
    • Line 69: warning: exported method ZKStore.DeleteTask should have comment or be unexported (golint)
    • Line 75: warning: exported method ZKStore.GetTask should have comment or be unexported (golint)
    • swan/manager/manager.go
    • Line 18: warning: exported type Manager should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 99: warning: exported method Manager.Start should have comment or be unexported (golint)
    • swan/config/agent.go
    • Line 14: warning: exported type AgentConfig should have comment or be unexported (golint)
    • Line 23: warning: exported type DNS should have comment or be unexported (golint)
    • Line 40: warning: exported type Janitor should have comment or be unexported (golint)
    • Line 50: warning: exported type IPAM should have comment or be unexported (golint)
    • Line 57: warning: exported function NewAgentConfig should have comment or be unexported (golint)
    • swan/types/weight.go
    • Line 3: warning: exported type UpdateWeightBody should have comment or be unexported (golint)
    • Line 7: warning: exported type UpdateWeightsBody should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell93%

Misspell Finds commonly misspelled English words

    • swan/mesos/scheduler.go
    • Line 710: warning: "avaliable" is a misspelling of "available" (misspell)
    • Line 718: warning: "avaliable" is a misspelling of "available" (misspell)
    • Line 721: warning: "avaliable" is a misspelling of "available" (misspell)
    • Line 733: warning: "avaliable" is a misspelling of "available" (misspell)
    • Line 849: warning: "emited" is a misspelling of "emitted" (misspell)
    • Line 916: warning: "avaliable" is a misspelling of "available" (misspell)
    • swan/agent/agent.go
    • Line 100: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 108: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 116: warning: "occured" is a misspelling of "occurred" (misspell)
    • swan/types/compose-ng.go
    • Line 96: warning: "definations" is a misspelling of "definitions" (misspell)
    • Line 142: warning: "Definations" is a misspelling of "Definitions" (misspell)
    • Line 208: warning: "definations" is a misspelling of "definitions" (misspell)
    • Line 701: warning: "Definations" is a misspelling of "Definitions" (misspell)
    • Line 768: warning: "seperator" is a misspelling of "separator" (misspell)