Preparing report...

Report for github.com/heptio/contour

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


gocyclo97%

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.

    • contour/internal/dag/gatewayapi_processor.go
    • Line 59: warning: cyclomatic complexity 28 of function (*GatewayAPIProcessor).Run() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 28 of function (*GatewayAPIProcessor).computeHTTPRoute() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 16 of function (*GatewayAPIProcessor).computeTLSRoute() is high (> 15) (gocyclo)
    • contour/internal/sorter/sorter.go
    • Line 49: warning: cyclomatic complexity 21 of function (headerMatchConditionSorter).Less() is high (> 15) (gocyclo)
    • Line 139: warning: cyclomatic complexity 20 of function (routeSorter).Less() is high (> 15) (gocyclo)
    • contour/internal/dag/httpproxy_processor.go
    • Line 364: warning: cyclomatic complexity 46 of function (*HTTPProxyProcessor).computeRoutes() is high (> 15) (gocyclo)
    • Line 111: warning: cyclomatic complexity 45 of function (*HTTPProxyProcessor).computeHTTPProxy() is high (> 15) (gocyclo)
    • Line 655: warning: cyclomatic complexity 18 of function (*HTTPProxyProcessor).processHTTPProxyTCPProxy() is high (> 15) (gocyclo)
    • contour/internal/dag/cache.go
    • Line 435: warning: cyclomatic complexity 35 of function (*KubernetesCache).secretTriggersRebuild() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 27 of function (*KubernetesCache).Insert() is high (> 15) (gocyclo)
    • Line 370: warning: cyclomatic complexity 23 of function (*KubernetesCache).serviceTriggersRebuild() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 19 of function (*KubernetesCache).remove() is high (> 15) (gocyclo)

golint82%

Golint is a linter for Go source code.

    • contour/internal/fixture/httpproxy.go
    • Line 75: warning: exported method ProxyBuilder.WithFQDN should have comment or be unexported (golint)
    • Line 81: warning: exported method ProxyBuilder.WithCertificate should have comment or be unexported (golint)
    • Line 87: warning: exported method ProxyBuilder.WithAuthServer should have comment or be unexported (golint)
    • contour/internal/k8s/clients.go
    • Line 87: warning: exported type Informer should have comment or be unexported (golint)
    • Line 89: warning: exported method Clients.InformerForResource should have comment or be unexported (golint)
    • Line 98: warning: exported method Clients.StartInformers should have comment or be unexported (golint)
    • Line 102: warning: exported method Clients.WaitForCacheSync should have comment or be unexported (golint)
    • Line 106: warning: exported method Clients.Cache should have comment or be unexported (golint)
    • contour/internal/k8s/converter.go
    • Line 39: warning: exported method DynamicClientHandler.OnAdd should have comment or be unexported (golint)
    • Line 48: warning: exported method DynamicClientHandler.OnUpdate should have comment or be unexported (golint)
    • Line 62: warning: exported method DynamicClientHandler.OnDelete should have comment or be unexported (golint)
    • Line 71: warning: exported type Converter should have comment or be unexported (golint)
    • contour/internal/contour/handler.go
    • Line 75: warning: exported method EventHandler.OnAdd should have comment or be unexported (golint)
    • Line 79: warning: exported method EventHandler.OnUpdate should have comment or be unexported (golint)
    • Line 83: warning: exported method EventHandler.OnDelete should have comment or be unexported (golint)
    • contour/internal/k8s/statusaddress.go
    • Line 141: warning: exported method StatusAddressUpdater.OnUpdate should have comment or be unexported (golint)
    • Line 149: warning: exported method StatusAddressUpdater.OnDelete should have comment or be unexported (golint)
    • Line 164: warning: exported method ServiceStatusLoadBalancerWatcher.OnAdd should have comment or be unexported (golint)
    • Line 180: warning: exported method ServiceStatusLoadBalancerWatcher.OnUpdate should have comment or be unexported (golint)
    • Line 196: warning: exported method ServiceStatusLoadBalancerWatcher.OnDelete should have comment or be unexported (golint)
    • contour/internal/envoy/v3/listener.go
    • Line 46: warning: exported type HTTPVersionType should have comment or be unexported (golint)
    • Line 49: warning: exported const HTTPVersionAuto should have comment (or a comment on this block) or be unexported (golint)
    • Line 565: warning: exported function FilterMisdirectedRequests should have comment or be unexported (golint)
    • Line 694: warning: exported function ContainsFallbackFilterChain should have comment or be unexported (golint)
    • contour/internal/xdscache/v3/endpointstranslator.go
    • Line 36: warning: exported type LocalityEndpoints should have comment or be unexported (golint)
    • Line 37: warning: exported type LoadBalancingEndpoint should have comment or be unexported (golint)
    • Line 338: warning: exported method EndpointsTranslator.OnAdd should have comment or be unexported (golint)
    • Line 352: warning: exported method EndpointsTranslator.OnUpdate should have comment or be unexported (golint)
    • Line 385: warning: exported method EndpointsTranslator.OnDelete should have comment or be unexported (golint)
    • Line 415: warning: exported method EndpointsTranslator.Query should have comment or be unexported (golint)
    • Line 435: warning: exported method EndpointsTranslator.TypeURL should have comment or be unexported (golint)
    • contour/internal/dag/status.go
    • Line 33: warning: exported type StatusWriter should have comment or be unexported (golint)
    • Line 37: warning: exported type ObjectStatusWriter should have comment or be unexported (golint)
    • Line 81: warning: exported method ObjectStatusWriter.WithValue should have comment or be unexported (golint)
    • Line 86: warning: exported method ObjectStatusWriter.SetInvalid should have comment or be unexported (golint)
    • Line 90: warning: exported method ObjectStatusWriter.SetValid should have comment or be unexported (golint)
    • contour/internal/fixture/service_fixtures.go
    • Line 21: warning: exported var ServiceRootsKuard should have comment or be unexported (golint)
    • Line 33: warning: exported var ServiceRootsHome should have comment or be unexported (golint)
    • Line 44: warning: exported var ServiceRootsFoo2 should have comment or be unexported (golint)
    • Line 55: warning: exported var ServiceRootsFoo3InvalidPort should have comment or be unexported (golint)
    • Line 66: warning: exported var ServiceMarketingGreen should have comment or be unexported (golint)
    • Line 77: warning: exported var ServiceRootsNginx should have comment or be unexported (golint)
    • Line 87: warning: exported var ServiceTeamAKuard should have comment or be unexported (golint)
    • Line 99: warning: exported var ServiceTeamBKuard should have comment or be unexported (golint)
    • contour/internal/status/proxystatus.go
    • Line 28: warning: exported type ProxyStatus should have comment or be unexported (golint)
    • Line 31: warning: exported const ProxyStatusValid should have comment (or a comment on this block) or be unexported (golint)
    • Line 110: warning: exported method ProxyUpdate.Mutate should have comment or be unexported (golint)
    • contour/internal/xdscache/v3/listener.go
    • Line 50: warning: exported type Listener should have comment or be unexported (golint)
    • Line 144: warning: exported type RateLimitConfig should have comment or be unexported (golint)
    • Line 185: warning: exported method ListenerConfig.SecureListeners should have comment or be unexported (golint)
    • Line 343: warning: exported method ListenerCache.TypeURL should have comment or be unexported (golint)
    • Line 345: warning: exported method ListenerCache.OnChange should have comment or be unexported (golint)
    • contour/internal/dag/dag.go
    • Line 46: warning: exported method ObserverFunc.OnChange should have comment or be unexported (golint)
    • Line 101: warning: exported type MatchCondition should have comment or be unexported (golint)
    • Line 392: warning: exported type HeaderValueMatchDescriptorEntry should have comment or be unexported (golint)
    • Line 418: warning: exported type HeaderValue should have comment or be unexported (golint)
    • Line 456: warning: exported method Route.Visit should have comment or be unexported (golint)
    • Line 500: warning: exported method VirtualHost.Visit should have comment or be unexported (golint)
    • Line 506: warning: exported method VirtualHost.Valid should have comment or be unexported (golint)
    • Line 546: warning: exported method SecureVirtualHost.Visit should have comment or be unexported (golint)
    • Line 556: warning: exported method SecureVirtualHost.Valid should have comment or be unexported (golint)
    • Line 563: warning: exported type ListenerName should have comment or be unexported (golint)
    • Line 582: warning: exported method Listener.Visit should have comment or be unexported (golint)
    • Line 596: warning: exported method TCPProxy.Visit should have comment or be unexported (golint)
    • Line 706: warning: exported method Cluster.Visit should have comment or be unexported (golint)
    • Line 774: warning: exported method ServiceCluster.Visit should have comment or be unexported (golint)
    • Line 819: warning: exported method Secret.Name should have comment or be unexported (golint)
    • Line 820: warning: exported method Secret.Namespace should have comment or be unexported (golint)
    • Line 821: warning: exported method Secret.Visit should have comment or be unexported (golint)
    • contour/internal/fixture/detailedcondition.go
    • Line 34: warning: exported method DetailedConditionBuilder.WithGeneration should have comment or be unexported (golint)
    • Line 39: warning: exported method DetailedConditionBuilder.Valid should have comment or be unexported (golint)
    • Line 49: warning: exported method DetailedConditionBuilder.Orphaned should have comment or be unexported (golint)
    • Line 57: warning: exported method DetailedConditionBuilder.WithError should have comment or be unexported (golint)
    • Line 66: warning: exported method DetailedConditionBuilder.WithErrorf should have comment or be unexported (golint)
    • Line 75: warning: exported method DetailedConditionBuilder.WithWarning should have comment or be unexported (golint)
    • Line 84: warning: exported method DetailedConditionBuilder.WithWarningf should have comment or be unexported (golint)
    • contour/internal/fixture/secret_fixtures.go
    • Line 20: warning: exported var SecretRootsCert should have comment or be unexported (golint)
    • Line 29: warning: exported var SecretProjectContourCert should have comment or be unexported (golint)
    • Line 35: warning: exported var SecretRootsFallback should have comment or be unexported (golint)
    • contour/internal/status/conditions.go
    • Line 30: warning: exported const ResourceHTTPRoute should have comment or be unexported (golint)
    • Line 31: warning: exported const ResourceTLSRoute should have comment or be unexported (golint)
    • Line 33: warning: exported const ConditionNotImplemented should have comment or be unexported (golint)
    • Line 34: warning: exported const ConditionResolvedRefs should have comment or be unexported (golint)
    • Line 36: warning: exported type RouteReasonType should have comment or be unexported (golint)
    • Line 38: warning: exported const ReasonNotImplemented should have comment or be unexported (golint)
    • Line 39: warning: exported const ReasonPathMatchType should have comment or be unexported (golint)
    • Line 40: warning: exported const ReasonHeaderMatchType should have comment or be unexported (golint)
    • Line 41: warning: exported const ReasonHTTPRouteFilterType should have comment or be unexported (golint)
    • Line 42: warning: exported const ReasonDegraded should have comment or be unexported (golint)
    • Line 43: warning: exported const ReasonValid should have comment or be unexported (golint)
    • Line 44: warning: exported const ReasonErrorsExist should have comment or be unexported (golint)
    • Line 45: warning: exported const ReasonGatewayAllowMismatch should have comment or be unexported (golint)
    • Line 47: warning: exported type GatewayClassReasonType should have comment or be unexported (golint)
    • Line 55: warning: exported type ConditionsUpdate should have comment or be unexported (golint)
    • Line 111: warning: exported method ConditionsUpdate.Mutate should have comment or be unexported (golint)
    • contour/internal/k8s/statuscache.go
    • Line 82: warning: exported method StatusUpdateCacher.Add should have comment or be unexported (golint)
    • Line 100: warning: exported method StatusUpdateCacher.GetStatus should have comment or be unexported (golint)
    • Line 122: warning: exported method StatusUpdateCacher.Send should have comment or be unexported (golint)
    • contour/internal/featuretests/kubernetes.go
    • Line 24: warning: exported function IngressBackend should have comment or be unexported (golint)
    • Line 57: warning: exported const RSA_PRIVATE_KEY should have comment (or a comment on this block) or be unexported (golint)
    • Line 86: warning: exported function Secretdata should have comment or be unexported (golint)
    • Line 93: warning: exported function Endpoints should have comment or be unexported (golint)
    • Line 103: warning: exported function Ports should have comment or be unexported (golint)
    • Line 107: warning: exported function Port should have comment or be unexported (golint)
    • Line 115: warning: exported function Addresses should have comment or be unexported (golint)
    • contour/pkg/config/parameters.go
    • Line 33: warning: exported const ContourServerType should have comment or be unexported (golint)
    • Line 34: warning: exported const EnvoyServerType should have comment or be unexported (golint)
    • Line 77: warning: exported const XDSv3 should have comment or be unexported (golint)
    • Line 93: warning: exported method ClusterDNSFamilyType.Validate should have comment or be unexported (golint)
    • Line 102: warning: exported const AutoClusterDNSFamily should have comment or be unexported (golint)
    • Line 103: warning: exported const IPv4ClusterDNSFamily should have comment or be unexported (golint)
    • Line 104: warning: exported const IPv6ClusterDNSFamily should have comment or be unexported (golint)
    • Line 109: warning: exported method AccessLogType.Validate should have comment or be unexported (golint)
    • Line 118: warning: exported const EnvoyAccessLog should have comment or be unexported (golint)
    • Line 119: warning: exported const JSONAccessLog should have comment or be unexported (golint)
    • Line 121: warning: exported type AccessLogFields should have comment or be unexported (golint)
    • Line 123: warning: exported method AccessLogFields.Validate should have comment or be unexported (golint)
    • Line 176: warning: exported method AccessLogFields.AsFieldMap should have comment or be unexported (golint)
    • Line 208: warning: exported method HTTPVersionType.Validate should have comment or be unexported (golint)
    • Line 217: warning: exported const HTTPVersion1 should have comment or be unexported (golint)
    • Line 218: warning: exported const HTTPVersion2 should have comment or be unexported (golint)
    • Line 412: warning: exported type HeadersPolicy should have comment or be unexported (golint)
    • Line 417: warning: exported method HeadersPolicy.Validate should have comment or be unexported (golint)
    • contour/internal/xdscache/v3/secret.go
    • Line 59: warning: exported method SecretCache.Query should have comment or be unexported (golint)
    • Line 75: warning: exported method SecretCache.TypeURL should have comment or be unexported (golint)
    • Line 77: warning: exported method SecretCache.OnChange should have comment or be unexported (golint)
    • contour/internal/envoy/bootstrap.go
    • Line 93: warning: exported method BootstrapConfig.GetXdsAddress should have comment or be unexported (golint)
    • Line 94: warning: exported method BootstrapConfig.GetXdsGRPCPort should have comment or be unexported (golint)
    • Line 95: warning: exported method BootstrapConfig.GetAdminAddress should have comment or be unexported (golint)
    • Line 98: warning: exported method BootstrapConfig.GetAdminPort should have comment or be unexported (golint)
    • Line 99: warning: exported method BootstrapConfig.GetAdminAccessLogPath should have comment or be unexported (golint)
    • Line 102: warning: exported method BootstrapConfig.GetDNSLookupFamily should have comment or be unexported (golint)
    • Line 119: warning: exported function WriteConfig should have comment or be unexported (golint)
    • contour/internal/xds/hash.go
    • Line 20: warning: exported const CONSTANT_HASH_VALUE should have comment or be unexported (golint)
    • Line 27: warning: exported method ConstantHashV3.ID should have comment or be unexported (golint)
    • contour/internal/xdscache/v3/cluster.go
    • Line 59: warning: exported method ClusterCache.Query should have comment or be unexported (golint)
    • Line 77: warning: exported method ClusterCache.TypeURL should have comment or be unexported (golint)
    • Line 79: warning: exported method ClusterCache.OnChange should have comment or be unexported (golint)
    • contour/internal/contour/metrics.go
    • Line 38: warning: exported method EventRecorder.OnAdd should have comment or be unexported (golint)
    • Line 43: warning: exported method EventRecorder.OnUpdate should have comment or be unexported (golint)
    • Line 48: warning: exported method EventRecorder.OnDelete should have comment or be unexported (golint)
    • Line 75: warning: exported method RebuildMetricsObserver.OnChange should have comment or be unexported (golint)
    • contour/internal/envoy/v3/route.go
    • Line 106: warning: comment on exported function RouteDirectResponse should be of the form "RouteDirectResponse ..." (golint)
    • Line 353: warning: exported function Headers should have comment or be unexported (golint)
    • Line 357: warning: exported function AppendHeader 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!


misspell99%

Misspell Finds commonly misspelled English words