Preparing report...

Report for github.com/xiaods/k8e

A+    Excellent!    Found 72 issues across 166 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!


gocyclo93%

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.

    • k8e/pkg/agent/netpol/network_policy_controller.go
    • Line 696: warning: cyclomatic complexity 52 of function (*NetworkPolicyController).syncPodFirewallChains() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 42 of function (*NetworkPolicyController).processIngressRules() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 34 of function (*NetworkPolicyController).processEgressRules() is high (> 15) (gocyclo)
    • Line 930: warning: cyclomatic complexity 34 of function cleanupStaleRules() is high (> 15) (gocyclo)
    • Line 1155: warning: cyclomatic complexity 34 of function (*NetworkPolicyController).buildNetworkPoliciesInfo() is high (> 15) (gocyclo)
    • Line 1531: warning: cyclomatic complexity 18 of function (*NetworkPolicyController).Cleanup() is high (> 15) (gocyclo)

golint57%

Golint is a linter for Go source code.

    • k8e/pkg/daemons/executor/embed.go
    • Line 24: warning: exported type Embedded should have comment or be unexported (golint)
    • Line 26: warning: exported method Embedded.Kubelet should have comment or be unexported (golint)
    • Line 37: warning: exported method Embedded.KubeProxy should have comment or be unexported (golint)
    • Line 48: warning: exported method Embedded.APIServer should have comment or be unexported (golint)
    • Line 61: warning: exported method Embedded.Scheduler should have comment or be unexported (golint)
    • Line 73: warning: exported method Embedded.ControllerManager should have comment or be unexported (golint)
    • k8e/pkg/etcd/controller.go
    • Line 14: warning: exported const NodeID should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type NodeControllerGetter should have comment or be unexported (golint)
    • Line 22: warning: exported function Register should have comment or be unexported (golint)
    • k8e/pkg/daemons/config/types.go
    • Line 18: warning: exported const FlannelBackendNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type Node should have comment or be unexported (golint)
    • Line 43: warning: exported type Containerd should have comment or be unexported (golint)
    • Line 54: warning: exported type Agent should have comment or be unexported (golint)
    • Line 92: warning: exported type Control should have comment or be unexported (golint)
    • Line 160: warning: exported type ControlRuntimeBootstrap should have comment or be unexported (golint)
    • Line 177: warning: exported type ControlRuntime should have comment or be unexported (golint)
    • Line 231: warning: exported type ArgString should have comment or be unexported (golint)
    • Line 244: warning: exported function GetArgsList should have comment or be unexported (golint)
    • k8e/pkg/agent/config/config.go
    • Line 35: warning: exported const DefaultPodManifestPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported function Get should have comment or be unexported (golint)
    • Line 54: warning: exported type HTTPRequester should have comment or be unexported (golint)
    • Line 56: warning: exported function Request should have comment or be unexported (golint)
    • k8e/pkg/etcd/etcd.go
    • Line 38: warning: exported type ETCD should have comment or be unexported (golint)
    • Line 428: warning: comment on exported function GetClient should be of the form "GetClient ..." (golint)
    • Line 473: warning: comment on exported function GetAdvertiseAddress should be of the form "GetAdvertiseAddress ..." (golint)
    • Line 707: warning: comment on exported function ClientURLs should be of the form "ClientURLs ..." (golint)
    • k8e/pkg/cluster/managed/drivers.go
    • Line 16: warning: exported type Driver should have comment or be unexported (golint)
    • Line 29: warning: exported function RegisterDriver should have comment or be unexported (golint)
    • Line 33: warning: exported function Registered should have comment or be unexported (golint)
    • Line 37: warning: exported function Default should have comment or be unexported (golint)
    • k8e/pkg/agent/netpol/utils.go
    • Line 217: warning: comment on exported method IPSet.Add should be of the form "Add ..." (golint)
    • Line 489: warning: comment on exported method Set.RefreshWithBuiltinOptions should be of the form "RefreshWithBuiltinOptions ..." (golint)
    • Line 543: warning: comment on exported function CacheSyncOrTimeout should be of the form "CacheSyncOrTimeout ..." (golint)
    • k8e/pkg/apis/k8e.cattle.io/v1/types.go
    • Line 11: warning: exported type Addon should have comment or be unexported (golint)
    • Line 19: warning: exported type AddonSpec should have comment or be unexported (golint)
    • Line 24: warning: exported type AddonStatus should have comment or be unexported (golint)
    • k8e/pkg/cli/cmds/root.go
    • Line 13: warning: exported var Debug should have comment or be unexported (golint)
    • Line 29: warning: exported function NewApp should have comment or be unexported (golint)
    • Line 45: warning: exported function SetupDebug should have comment or be unexported (golint)
    • k8e/pkg/datadir/datadir.go
    • Line 13: warning: exported var DefaultDataDir should have comment or be unexported (golint)
    • Line 19: warning: exported function Resolve should have comment or be unexported (golint)
    • Line 23: warning: exported function LocalHome should have comment or be unexported (golint)
    • k8e/pkg/passwd/passwd.go
    • Line 19: warning: exported type Passwd should have comment or be unexported (golint)
    • Line 24: warning: exported function Read should have comment or be unexported (golint)
    • Line 63: warning: exported method Passwd.Check should have comment or be unexported (golint)
    • Line 71: warning: exported method Passwd.EnsureUser should have comment or be unexported (golint)
    • Line 110: warning: exported method Passwd.Pass should have comment or be unexported (golint)
    • k8e/pkg/nodeconfig/nodeconfig.go
    • Line 17: warning: exported var NodeArgsAnnotation should have comment or be unexported (golint)
    • Line 23: warning: exported const OmittedValue should have comment (or a comment on this block) or be unexported (golint)
    • Line 70: warning: exported function SetNodeConfigAnnotations should have comment or be unexported (golint)
    • k8e/pkg/bootstrap/bootstrap.go
    • Line 15: warning: exported function Handler should have comment or be unexported (golint)
    • Line 22: warning: exported function Write should have comment or be unexported (golint)
    • Line 44: warning: exported function Read should have comment or be unexported (golint)
    • k8e/pkg/server/types.go
    • Line 9: warning: exported type Config should have comment or be unexported (golint)
    • Line 20: warning: exported type CustomControllers should have comment or be unexported (golint)
    • k8e/pkg/clientaccess/token.go
    • Line 41: warning: exported type OverrideURLCallback should have comment or be unexported (golint)
    • Line 43: warning: exported type Info should have comment or be unexported (golint)
    • Line 71: warning: comment on exported function ParseAndValidateTokenForUser should be of the form "ParseAndValidateTokenForUser ..." (golint)
    • k8e/pkg/server/context.go
    • Line 20: warning: exported type Context should have comment or be unexported (golint)
    • Line 31: warning: exported method Context.Start should have comment or be unexported (golint)
    • k8e/pkg/daemons/executor/etcd.go
    • Line 10: warning: exported method Embedded.CurrentETCDOptions should have comment or be unexported (golint)
    • Line 14: warning: exported method Embedded.ETCD should have comment or be unexported (golint)
    • k8e/pkg/agent/templates/templates.go
    • Line 10: warning: exported type ContainerdConfig should have comment or be unexported (golint)
    • Line 16: warning: exported const ContainerdConfigTemplate should have comment or be unexported (golint)
    • Line 82: warning: exported function ParseTemplateFromConfig should have comment or be unexported (golint)
    • k8e/pkg/cli/cmds/etcd_snapshot.go
    • Line 8: warning: exported const EtcdSnapshotCommand should have comment or be unexported (golint)
    • Line 10: warning: exported function NewEtcdSnapshotCommand should have comment or be unexported (golint)
    • k8e/pkg/token/read.go
    • Line 14: warning: exported function Random should have comment or be unexported (golint)
    • Line 23: warning: exported function ReadFile should have comment or be unexported (golint)
    • k8e/pkg/cli/cmds/log.go
    • Line 18: warning: exported type Log should have comment or be unexported (golint)
    • Line 26: warning: exported var LogConfig should have comment or be unexported (golint)
    • Line 52: warning: exported function InitLogging should have comment or be unexported (golint)
    • k8e/pkg/daemons/executor/executor.go
    • Line 19: warning: exported type Executor should have comment or be unexported (golint)
    • Line 29: warning: exported type ETCDConfig should have comment or be unexported (golint)
    • Line 47: warning: exported type ServerTrust should have comment or be unexported (golint)
    • Line 54: warning: exported type PeerTrust should have comment or be unexported (golint)
    • Line 61: warning: exported type InitialOptions should have comment or be unexported (golint)
    • Line 67: warning: exported method ETCDConfig.ToConfigFile should have comment or be unexported (golint)
    • Line 80: warning: exported function Set should have comment or be unexported (golint)
    • Line 84: warning: exported function Kubelet should have comment or be unexported (golint)
    • Line 88: warning: exported function KubeProxy should have comment or be unexported (golint)
    • Line 92: warning: exported function APIServer should have comment or be unexported (golint)
    • Line 96: warning: exported function Scheduler should have comment or be unexported (golint)
    • Line 100: warning: exported function ControllerManager should have comment or be unexported (golint)
    • Line 104: warning: exported function CurrentETCDOptions should have comment or be unexported (golint)
    • Line 108: warning: exported function ETCD should have comment or be unexported (golint)
    • k8e/pkg/server/server.go
    • Line 41: warning: exported const MasterRoleLabelKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function ResolveDataDir should have comment or be unexported (golint)
    • Line 50: warning: exported function StartServer should have comment or be unexported (golint)
    • Line 241: warning: exported function HomeKubeConfig should have comment or be unexported (golint)
    • Line 382: warning: exported function FormatToken should have comment or be unexported (golint)
    • k8e/pkg/cli/cmds/agent.go
    • Line 12: warning: exported type Agent should have comment or be unexported (golint)
    • Line 47: warning: exported type AgentShared should have comment or be unexported (golint)
    • Line 53: warning: exported var AgentConfig should have comment or be unexported (golint)
    • Line 171: warning: exported function CheckSELinuxFlags should have comment or be unexported (golint)
    • Line 181: warning: exported function NewAgentCommand should have comment or be unexported (golint)
    • k8e/pkg/agent/loadbalancer/loadbalancer.go
    • Line 18: warning: exported type LoadBalancer should have comment or be unexported (golint)
    • Line 35: warning: exported const RandomPort should have comment or be unexported (golint)
    • Line 38: warning: exported var SupervisorServiceName should have comment or be unexported (golint)
    • Line 43: warning: exported function New should have comment or be unexported (golint)
    • Line 102: warning: exported method LoadBalancer.Update should have comment or be unexported (golint)
    • Line 116: warning: exported method LoadBalancer.LoadBalancerServerURL should have comment or be unexported (golint)
    • k8e/pkg/servicelb/controller.go
    • Line 38: warning: exported const Ready should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function Register should have comment or be unexported (golint)
    • k8e/pkg/util/file.go
    • Line 9: warning: exported function SetFileModeForPath should have comment or be unexported (golint)
    • Line 13: warning: exported function SetFileModeForFile should have comment or be unexported (golint)
    • k8e/pkg/agent/run.go
    • Line 40: warning: exported var InternalIPLabel should have comment or be unexported (golint)
    • Line 130: warning: exported function Run should have comment or be unexported (golint)
    • k8e/pkg/cli/cmds/server.go
    • Line 11: warning: exported const DisableItems should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type Server should have comment or be unexported (golint)
    • Line 83: warning: exported var ServerConfig should have comment or be unexported (golint)
    • Line 85: warning: exported function NewServerCommand should have comment or be unexported (golint)
    • k8e/pkg/cli/server/server.go
    • Line 36: warning: exported function Run should have comment or be unexported (golint)
    • Line 43: warning: exported function RunWithControllers should have comment or be unexported (golint)
    • k8e/pkg/version/version.go
    • Line 11: warning: exported var Program should have comment or be unexported (golint)
    • Line 17: warning: exported function PrintK8eASCIIArt should have comment or be unexported (golint)
    • k8e/pkg/daemons/control/deps/deps.go
    • Line 35: warning: exported const RequestHeaderCN should have comment (or a comment on this block) or be unexported (golint)
    • Line 71: warning: exported function KubeConfig 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!