Preparing report...

Report for github.com/alibaba/openyurt

A+    Excellent!    Found 56 issues across 132 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!


gocyclo92%

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.

    • openyurt/pkg/controller/nodelifecycle/node_lifecycle_controller_test.go
    • Line 1750: warning: cyclomatic complexity 19 of function TestMonitorNodeHealthUpdateNodeAndPodStatusWithLease() is high (> 15) (gocyclo)
    • Line 1478: warning: cyclomatic complexity 17 of function TestMonitorNodeHealthUpdateStatus() is high (> 15) (gocyclo)
    • Line 2448: warning: cyclomatic complexity 17 of function TestMonitorNodeHealthMarkPodsNotReadyRetry() is high (> 15) (gocyclo)
    • Line 197: warning: cyclomatic complexity 17 of function TestMonitorNodeHealthEvictPods() is high (> 15) (gocyclo)

golint63%

Golint is a linter for Go source code.

    • openyurt/test/e2e/common/node/ens/ens.go
    • Line 28: warning: exported type EnsController should have comment or be unexported (golint)
    • Line 33: warning: exported function NewEnsController should have comment or be unexported (golint)
    • Line 41: warning: exported method EnsController.RebootNode should have comment or be unexported (golint)
    • Line 45: warning: exported method EnsController.CreateNode should have comment or be unexported (golint)
    • Line 49: warning: exported method EnsController.StartNode should have comment or be unexported (golint)
    • Line 53: warning: exported method EnsController.DeleteNode should have comment or be unexported (golint)
    • Line 57: warning: exported method EnsController.GetNodeInfo should have comment or be unexported (golint)
    • Line 61: warning: exported method EnsController.StopNode should have comment or be unexported (golint)
    • openyurt/pkg/yurthub/metrics/metrics.go
    • Line 36: warning: exported type HubMetrics should have comment or be unexported (golint)
    • Line 97: warning: exported method HubMetrics.Reset should have comment or be unexported (golint)
    • Line 104: warning: exported method HubMetrics.ObserveServerHealthy should have comment or be unexported (golint)
    • Line 108: warning: exported method HubMetrics.IncInFlightRequests should have comment or be unexported (golint)
    • Line 113: warning: exported method HubMetrics.DecInFlightRequests should have comment or be unexported (golint)
    • Line 118: warning: exported method HubMetrics.IncRejectedRequestCounter should have comment or be unexported (golint)
    • Line 122: warning: exported method HubMetrics.IncClosableConns should have comment or be unexported (golint)
    • Line 126: warning: exported method HubMetrics.DecClosableConns should have comment or be unexported (golint)
    • Line 130: warning: exported method HubMetrics.SetClosableConns should have comment or be unexported (golint)
    • openyurt/pkg/yurttunnel/constants/constants.go
    • Line 20: warning: exported const YurttunnelServerAgentPort should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported const YurttunnelCSROrg should be of the form "YurttunnelCSROrg ..." (golint)
    • Line 44: warning: comment on exported const YurttunnelAgentPodIPEnv should be of the form "YurttunnelAgentPodIPEnv ..." (golint)
    • Line 47: warning: comment on exported const ProxyHostHeaderKey should be of the form "ProxyHostHeaderKey ..." (golint)
    • Line 50: warning: comment on exported const YurttunnelANPInterceptorReadTimeoutSec should be of the form "YurttunnelANPInterceptorReadTimeoutSec ..." (golint)
    • Line 52: warning: comment on exported const YurttunnelANPInterceptorKeepAlivePeriodSec should be of the form "YurttunnelANPInterceptorKeepAlivePeriodSec ..." (golint)
    • Line 54: warning: comment on exported const YurttunnelANPProxierReadTimeoutSec should be of the form "YurttunnelANPProxierReadTimeoutSec ..." (golint)
    • Line 56: warning: comment on exported const YurttunnelANPGrpcKeepAliveTimeSec should be of the form "YurttunnelANPGrpcKeepAliveTimeSec ..." (golint)
    • Line 58: warning: comment on exported const YurttunnelANPGrpcKeepAliveTimeoutSec should be of the form "YurttunnelANPGrpcKeepAliveTimeoutSec ..." (golint)
    • openyurt/pkg/yurttunnel/util/util.go
    • Line 21: warning: comment on exported const YurttunnelServerDnatConfigMapNs should be of the form "YurttunnelServerDnatConfigMapNs ..." (golint)
    • Line 27: warning: exported var YurttunnelServerDnatConfigMapName should have comment or be unexported (golint)
    • Line 67: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • openyurt/test/e2e/common/pod/pod.go
    • Line 29: warning: exported function ListPods should have comment or be unexported (golint)
    • Line 33: warning: exported function CreatePod should have comment or be unexported (golint)
    • Line 41: warning: exported function GetPod should have comment or be unexported (golint)
    • Line 45: warning: exported function DeletePod should have comment or be unexported (golint)
    • Line 49: warning: exported function VerifyPodsRunning should have comment or be unexported (golint)
    • Line 53: warning: exported function WaitTimeoutForPodRunning should have comment or be unexported (golint)
    • openyurt/pkg/yurttunnel/dns/event.go
    • Line 19: warning: exported type EventType should have comment or be unexported (golint)
    • Line 22: warning: exported const NodeAdd should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type Event should have comment or be unexported (golint)
    • openyurt/test/e2e/common/ns/ns.go
    • Line 30: warning: exported function DeleteNameSpace should have comment or be unexported (golint)
    • Line 42: warning: exported function CreateNameSpace should have comment or be unexported (golint)
    • Line 53: warning: exported function ListNameSpaces should have comment or be unexported (golint)
    • Line 57: warning: exported function GetNameSpace should have comment or be unexported (golint)
    • openyurt/pkg/yurttunnel/pki/pki.go
    • Line 32: warning: comment on exported function GenTLSConfigUseCertMgrAndCertPool should be of the form "GenTLSConfigUseCertMgrAndCertPool ..." (golint)
    • Line 113: warning: comment on exported function GenTLSConfigUseCertMgrAndCA should be of the form "GenTLSConfigUseCertMgrAndCA ..." (golint)
    • openyurt/test/e2e/common/node/ecs/ecs.go
    • Line 28: warning: exported type EcsController should have comment or be unexported (golint)
    • Line 33: warning: exported function NewEcsController should have comment or be unexported (golint)
    • Line 41: warning: exported method EcsController.RebootNode should have comment or be unexported (golint)
    • Line 45: warning: exported method EcsController.CreateNode should have comment or be unexported (golint)
    • Line 49: warning: exported method EcsController.StopNode should have comment or be unexported (golint)
    • Line 53: warning: exported method EcsController.StartNode should have comment or be unexported (golint)
    • Line 57: warning: exported method EcsController.GetNodeInfo should have comment or be unexported (golint)
    • Line 61: warning: exported method EcsController.DeleteNode should have comment or be unexported (golint)
    • Line 65: warning: exported method EcsController.CheckEcsInstanceStatus should have comment or be unexported (golint)
    • openyurt/test/e2e/yurt/yurt.go
    • Line 35: warning: exported const YurtE2ENamespaceName should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported const PodStartShortTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported function Register should have comment or be unexported (golint)
    • openyurt/pkg/yurttunnel/server/interceptor.go
    • Line 40: warning: exported var HeaderTransferEncoding should have comment or be unexported (golint)
    • Line 44: warning: comment on exported type RequestInterceptor should be of the form "RequestInterceptor ..." (with optional leading article) (golint)
    • openyurt/pkg/yurtctl/lock/lock.go
    • Line 35: warning: exported const AnnotationAcquireTime should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported var ErrAcquireLock should have comment or be unexported (golint)
    • openyurt/pkg/yurthub/network/iptables.go
    • Line 34: warning: exported type IptablesManager should have comment or be unexported (golint)
    • Line 39: warning: exported function NewIptablesManager should have comment or be unexported (golint)
    • Line 77: warning: exported method IptablesManager.EnsureIptablesRules should have comment or be unexported (golint)
    • openyurt/pkg/yurttunnel/server/metrics/metrics.go
    • Line 36: warning: exported type TunnelServerMetrics should have comment or be unexported (golint)
    • Line 76: warning: exported method TunnelServerMetrics.Reset should have comment or be unexported (golint)
    • Line 82: warning: exported method TunnelServerMetrics.IncInFlightRequests should have comment or be unexported (golint)
    • Line 87: warning: exported method TunnelServerMetrics.DecInFlightRequests should have comment or be unexported (golint)
    • Line 92: warning: exported method TunnelServerMetrics.ObserveCloudNodes should have comment or be unexported (golint)
    • openyurt/test/e2e/common/node/node.go
    • Line 27: warning: exported const NodeTypeAliyunECS should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type NodeController should have comment or be unexported (golint)
    • Line 41: warning: exported function NewNodeController should have comment or be unexported (golint)
    • openyurt/pkg/projectinfo/projectinfo.go
    • Line 32: warning: exported function ShortAgentVersion should have comment or be unexported (golint)
    • Line 40: warning: exported function ShortServerVersion should have comment or be unexported (golint)
    • Line 48: warning: exported function GetProjectPrefix should have comment or be unexported (golint)
    • Line 52: warning: exported function GetServerName should have comment or be unexported (golint)
    • Line 56: warning: exported function GetAgentName should have comment or be unexported (golint)
    • openyurt/test/e2e/yurttunnel/yurttunnel.go
    • Line 46: warning: exported const YurttunnelE2eNamespaceName should have comment (or a comment on this block) or be unexported (golint)
    • Line 52: warning: exported const PodStartShortTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported function PreCheckNode should have comment or be unexported (golint)
    • Line 76: warning: exported function PreCheckTunnelPod should have comment or be unexported (golint)
    • Line 101: warning: exported function RunExecWithOutPut should have comment or be unexported (golint)
    • Line 145: warning: exported function Register should have comment or be unexported (golint)
    • openyurt/pkg/yurthub/kubernetes/serializer/serializer.go
    • Line 48: warning: exported function NewDefaultRESTMapperFromScheme should have comment or be unexported (golint)
    • Line 144: warning: exported type UnstructuredNegotiatedSerializer should have comment or be unexported (golint)
    • Line 159: warning: exported method UnstructuredNegotiatedSerializer.SupportedMediaTypes should have comment or be unexported (golint)
    • Line 209: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • openyurt/test/e2e/common/node/user/user.go
    • Line 27: warning: exported type UserController should have comment or be unexported (golint)
    • Line 31: warning: exported function NewUserController should have comment or be unexported (golint)
    • Line 37: warning: exported method UserController.CreateNode should have comment or be unexported (golint)
    • Line 41: warning: exported method UserController.StartNode should have comment or be unexported (golint)
    • Line 53: warning: exported method UserController.DeleteNode should have comment or be unexported (golint)
    • Line 57: warning: exported method UserController.GetNodeInfo should have comment or be unexported (golint)
    • Line 61: warning: exported method UserController.RebootNode should have comment or be unexported (golint)
    • Line 65: warning: exported method UserController.StopNode should have comment or be unexported (golint)
    • openyurt/test/e2e/yurthub/yurthub.go
    • Line 42: warning: exported const YurtHubNamespaceName should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported function Register should have comment or be unexported (golint)
    • Line 150: warning: comment on exported function GetNodeID should be of the form "GetNodeID ..." (golint)
    • openyurt/pkg/yurthub/network/network.go
    • Line 30: warning: exported const SyncNetworkPeriod should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type NetworkManager should have comment or be unexported (golint)
    • Line 41: warning: exported function NewNetworkManager should have comment or be unexported (golint)
    • Line 64: warning: exported method NetworkManager.Run should have comment or be unexported (golint)
    • openyurt/pkg/yurthub/util/util.go
    • Line 329: warning: exported function LoadRESTClientConfig should have comment or be unexported (golint)
    • Line 345: warning: exported function LoadKubeConfig should have comment or be unexported (golint)
    • Line 355: warning: exported function CreateKubeConfigFile 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!


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)