Preparing report...

Report for github.com/linkerd/linkerd2

(v18.9.1+incompatible)

A+    Excellent!    Found 56 issues across 104 files

Tweet

gofmt87%

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!


gocyclo89%

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.

    • cli/cmd/top.go
    • Line 260: warning: cyclomatic complexity 17 of function tableInsert() is high (> 15) (gocyclo)
    • cli/cmd/inject.go
    • Line 427: warning: cyclomatic complexity 24 of function injectResource() is high (> 15) (gocyclo)
    • Line 741: warning: cyclomatic complexity 17 of function checkSidecars() is high (> 15) (gocyclo)

golint63%

Golint is a linter for Go source code.

    • pkg/k8s/api.go
    • Line 23: warning: exported type KubernetesAPI should have comment or be unexported (golint)
    • Line 27: warning: exported method KubernetesAPI.NewClient should have comment or be unexported (golint)
    • Line 38: warning: exported method KubernetesAPI.GetVersionInfo should have comment or be unexported (golint)
    • Line 62: warning: exported method KubernetesAPI.CheckVersion should have comment or be unexported (golint)
    • Line 77: warning: exported method KubernetesAPI.CheckProxyVersion should have comment or be unexported (golint)
    • Line 93: warning: exported method KubernetesAPI.NamespaceExists should have comment or be unexported (golint)
    • controller/api/public/test_helper.go
    • Line 16: warning: exported type MockApiClient should have comment or be unexported (golint)
    • Line 22: warning: don't use underscores in Go names; struct field Api_TapClientToReturn should be APITapClientToReturn (golint)
    • Line 23: warning: don't use underscores in Go names; struct field Api_TapByResourceClientToReturn should be APITapByResourceClientToReturn (golint)
    • Line 26: warning: exported method MockApiClient.StatSummary should have comment or be unexported (golint)
    • Line 30: warning: exported method MockApiClient.Version should have comment or be unexported (golint)
    • Line 34: warning: exported method MockApiClient.ListPods should have comment or be unexported (golint)
    • Line 38: warning: exported method MockApiClient.Tap should have comment or be unexported (golint)
    • Line 42: warning: exported method MockApiClient.TapByResource should have comment or be unexported (golint)
    • Line 46: warning: exported method MockApiClient.SelfCheck should have comment or be unexported (golint)
    • Line 50: warning: don't use underscores in Go names; type MockApi_TapClient should be MockAPITapClient (golint)
    • Line 50: warning: exported type MockApi_TapClient should have comment or be unexported (golint)
    • Line 56: warning: exported method MockApi_TapClient.Recv should have comment or be unexported (golint)
    • Line 72: warning: don't use underscores in Go names; type MockApi_TapByResourceClient should be MockAPITapByResourceClient (golint)
    • Line 72: warning: exported type MockApi_TapByResourceClient should have comment or be unexported (golint)
    • Line 78: warning: exported method MockApi_TapByResourceClient.Recv should have comment or be unexported (golint)
    • Line 98: warning: exported type MockProm should have comment or be unexported (golint)
    • Line 104: warning: exported type PodCounts should have comment or be unexported (golint)
    • Line 110: warning: comment on exported method MockProm.Query should be of the form "Query ..." (golint)
    • Line 117: warning: exported method MockProm.QueryRange should have comment or be unexported (golint)
    • Line 123: warning: exported method MockProm.LabelValues should have comment or be unexported (golint)
    • Line 126: warning: exported method MockProm.Series should have comment or be unexported (golint)
    • Line 130: warning: exported function GenStatSummaryResponse should have comment or be unexported (golint)
    • pkg/version/version.go
    • Line 15: warning: comment on exported var Version should be of the form "Version ..." (golint)
    • Line 38: warning: exported function CheckClientVersion should have comment or be unexported (golint)
    • Line 47: warning: exported function CheckServerVersion should have comment or be unexported (golint)
    • Line 64: warning: exported function GetLatestVersion should have comment or be unexported (golint)
    • pkg/k8s/k8s.go
    • Line 12: warning: exported const All should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: comment on exported var StatAllResourceTypes should be of the form "StatAllResourceTypes ..." (golint)
    • Line 100: warning: comment on exported function ShortNameFromCanonicalResourceName should be of the form "ShortNameFromCanonicalResourceName ..." (golint)
    • pkg/k8s/labels.go
    • Line 83: warning: exported const TLSCertFileName should have comment (or a comment on this block) or be unexported (golint)
    • Line 113: warning: exported function IsMeshed should have comment or be unexported (golint)
    • Line 135: warning: exported method TLSIdentity.ToDNSName should have comment or be unexported (golint)
    • Line 140: warning: exported method TLSIdentity.ToSecretName should have comment or be unexported (golint)
    • Line 144: warning: exported method TLSIdentity.ToControllerIdentity should have comment or be unexported (golint)
    • pkg/healthcheck/healthcheck.go
    • Line 19: warning: exported type Checks should have comment or be unexported (golint)
    • Line 54: warning: exported const KubernetesAPICategory should have comment (or a comment on this block) or be unexported (golint)
    • Line 75: warning: exported type CheckResult should have comment or be unexported (golint)
    • Line 84: warning: exported type HealthCheckOptions should have comment or be unexported (golint)
    • Line 96: warning: exported type HealthChecker should have comment or be unexported (golint)
    • Line 108: warning: exported function NewHealthChecker should have comment or be unexported (golint)
    • cli/cmd/inject.go
    • Line 33: warning: comment on exported const PodNamespaceEnvVarName should be of the form "PodNamespaceEnvVarName ..." (golint)
    • pkg/addr/addr.go
    • Line 12: warning: exported function PublicAddressToString should have comment or be unexported (golint)
    • Line 17: warning: exported function PublicIPToString should have comment or be unexported (golint)
    • Line 22: warning: exported function ProxyAddressToString should have comment or be unexported (golint)
    • Line 27: warning: exported function ProxyAddressesToString should have comment or be unexported (golint)
    • Line 35: warning: exported function ProxyIPToString should have comment or be unexported (golint)
    • Line 40: warning: exported function ProxyIPV4 should have comment or be unexported (golint)
    • Line 49: warning: exported function ParseProxyIPV4 should have comment or be unexported (golint)
    • Line 65: warning: exported function PublicIPV4 should have comment or be unexported (golint)
    • Line 74: warning: exported function ParsePublicIPV4 should have comment or be unexported (golint)
    • controller/k8s/api.go
    • Line 24: warning: exported type ApiResource should have comment or be unexported (golint)
    • Line 27: warning: exported const CM should have comment (or a comment on this block) or be unexported (golint)
    • Line 116: warning: exported method API.NS should have comment or be unexported (golint)
    • Line 123: warning: exported method API.Deploy should have comment or be unexported (golint)
    • Line 130: warning: exported method API.RS should have comment or be unexported (golint)
    • Line 137: warning: exported method API.Pod should have comment or be unexported (golint)
    • Line 144: warning: exported method API.RC should have comment or be unexported (golint)
    • Line 151: warning: exported method API.Svc should have comment or be unexported (golint)
    • Line 158: warning: exported method API.Endpoint should have comment or be unexported (golint)
    • Line 165: warning: exported method API.CM should have comment or be unexported (golint)
    • controller/api/public/client.go
    • Line 181: warning: exported function NewInternalClient should have comment or be unexported (golint)
    • Line 190: warning: exported function NewExternalClient should have comment or be unexported (golint)
    • proxy-init/iptables/iptables.go
    • Line 13: warning: exported const RedirectAllMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported var ExecutionTraceId should have comment or be unexported (golint)
    • Line 23: warning: exported type FirewallConfiguration should have comment or be unexported (golint)
    • pkg/prometheus/prometheus.go
    • Line 12: warning: comment on exported function NewGrpcServer should be of the form "NewGrpcServer ..." (golint)
    • Line 24: warning: comment on exported var RequestDurationBucketsSeconds should be of the form "RequestDurationBucketsSeconds ..." (golint)
    • Line 32: warning: comment on exported var ResponseSizeBuckets should be of the form "ResponseSizeBuckets ..." (golint)
    • Line 40: warning: comment on exported function WithTelemetry should be of the form "WithTelemetry ..." (golint)
    • cli/cmd/stat.go
    • Line 313: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • controller/api/util/api_utils.go
    • Line 50: warning: exported type StatSummaryRequestParams should have comment or be unexported (golint)
    • Line 64: warning: exported type TapRequestParams should have comment or be unexported (golint)
    • Line 108: warning: exported function BuildStatSummaryRequest should have comment or be unexported (golint)
    • Line 249: warning: exported function BuildTapByResourceRequest should have comment or be unexported (golint)
    • Line 403: warning: exported function RenderTapEvent should have comment or be unexported (golint)
    • controller/ca/ca.go
    • Line 14: warning: comment on exported type CA should be of the form "CA ..." (with optional leading article) (golint)
    • Line 50: warning: exported type CertificateAndPrivateKey should have comment or be unexported (golint)
    • Line 107: warning: comment on exported method CA.TrustAnchorPEM should be of the form "TrustAnchorPEM ..." (golint)
    • controller/ca/controller.go
    • Line 20: warning: exported type CertificateController should have comment or be unexported (golint)
    • Line 34: warning: exported function NewCertificateController should have comment or be unexported (golint)
    • Line 60: warning: exported method CertificateController.Run should have comment or be unexported (golint)
    • web/srv/server.go
    • Line 23: warning: exported type Server should have comment or be unexported (golint)
    • Line 54: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 115: warning: exported method Server.RenderTemplate should have comment or be unexported (golint)
    • Line 128: warning: if block ends with a return statement, so drop this else and outdent its block (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!


misspell98%

Misspell Finds commonly misspelled English words