Preparing report...

Report for github.com/projectcalico/typha

A+    Excellent!    Found 20 issues across 52 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!


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.


golint63%

Golint is a linter for Go source code.

    • typha/pkg/snapcache/cache.go
    • Line 77: warning: comment on exported type Cache should be of the form "Cache ..." (with optional leading article) (golint)
    • Line 144: warning: exported type Config should have comment or be unexported (golint)
    • Line 150: warning: exported method Config.ApplyDefaults should have comment or be unexported (golint)
    • Line 167: warning: exported function New should have comment or be unexported (golint)
    • Line 401: warning: exported type Breadcrumb should have comment or be unexported (golint)
    • Line 413: warning: exported method Breadcrumb.Next should have comment or be unexported (golint)
    • typha/pkg/syncclient/sync_client.go
    • Line 43: warning: exported type Options should have comment or be unexported (golint)
    • Line 92: warning: exported function New should have comment or be unexported (golint)
    • Line 126: warning: exported type SyncerClient should have comment or be unexported (golint)
    • Line 148: warning: exported method SyncerClient.Start should have comment or be unexported (golint)
    • typha/pkg/syncserver/sync_server.go
    • Line 46: warning: exported var ErrReadFailed should have comment or be unexported (golint)
    • Line 112: warning: exported const PortRandom should have comment (or a comment on this block) or be unexported (golint)
    • Line 115: warning: exported type Server should have comment or be unexported (golint)
    • Line 131: warning: exported type BreadcrumbProvider should have comment or be unexported (golint)
    • Line 135: warning: exported type Config should have comment or be unexported (golint)
    • Line 157: warning: exported method Config.ApplyDefaults should have comment or be unexported (golint)
    • Line 218: warning: exported method Config.ListenPort should have comment or be unexported (golint)
    • Line 230: warning: exported function New should have comment or be unexported (golint)
    • Line 255: warning: exported method Server.Start should have comment or be unexported (golint)
    • Line 261: warning: exported method Server.SetMaxConns should have comment or be unexported (golint)
    • Line 265: warning: exported method Server.Port should have comment or be unexported (golint)
    • typha/pkg/daemon/daemon.go
    • Line 114: warning: exported function New should have comment or be unexported (golint)
    • Line 129: warning: exported method TyphaDaemon.InitializeAndServeForever should have comment or be unexported (golint)
    • Line 463: warning: exported method ClientV3Shim.FelixSyncerByIface should have comment or be unexported (golint)
    • Line 467: warning: exported method ClientV3Shim.BGPSyncerByIface should have comment or be unexported (golint)
    • Line 471: warning: exported method ClientV3Shim.TunnelIPAllocationSyncerByIface should have comment or be unexported (golint)
    • typha/pkg/k8s/lookup.go
    • Line 29: warning: exported function NewK8sAPI should have comment or be unexported (golint)
    • Line 33: warning: exported type RealK8sAPI should have comment or be unexported (golint)
    • Line 56: warning: exported method RealK8sAPI.GetNumTyphas should have comment or be unexported (golint)
    • Line 86: warning: exported method RealK8sAPI.GetNumNodes should have comment or be unexported (golint)
    • typha/pkg/tlsutils/tlsutils.go
    • Line 32: warning: comment on exported function CertificateVerifier should be of the form "CertificateVerifier ..." (golint)
    • Line 114: warning: comment on exported function PanicIfErr should be of the form "PanicIfErr ..." (golint)
    • Line 124: warning: exported function MakeCACert should have comment or be unexported (golint)
    • Line 159: warning: exported function MakePeerCert should have comment or be unexported (golint)
    • Line 211: warning: exported function WriteCert should have comment or be unexported (golint)
    • Line 221: warning: exported function WriteKey should have comment or be unexported (golint)
    • typha/pkg/config/config_params.go
    • Line 33: warning: exported var IfaceListRegexp should have comment or be unexported (golint)
    • Line 52: warning: exported const Default should have comment (or a comment on this block) or be unexported (golint)
    • Line 59: warning: exported var SourcesInDescendingOrder should have comment or be unexported (golint)
    • Line 77: warning: exported method Source.Local should have comment or be unexported (golint)
    • Line 155: warning: exported type ProtoPort should have comment or be unexported (golint)
    • Line 160: warning: comment on exported method Config.UpdateFrom should be of the form "UpdateFrom ..." (golint)
    • Line 238: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 266: warning: exported method Config.DatastoreConfig should have comment or be unexported (golint)
    • Line 306: warning: comment on exported method Config.Validate should be of the form "Validate ..." (golint)
    • Line 459: warning: exported method Config.RawValues should have comment or be unexported (golint)
    • Line 463: warning: exported function New should have comment or be unexported (golint)
    • typha/pkg/config/file_loader.go
    • Line 25: warning: exported function LoadConfigFile should have comment or be unexported (golint)
    • Line 37: warning: exported function LoadConfigFileData should have comment or be unexported (golint)
    • typha/pkg/config/param_types.go
    • Line 35: warning: exported const MinIptablesMarkBits should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported type Metadata should have comment or be unexported (golint)
    • Line 47: warning: exported method Metadata.GetMetadata should have comment or be unexported (golint)
    • Line 63: warning: exported type BoolParam should have comment or be unexported (golint)
    • Line 67: warning: exported method BoolParam.Parse should have comment or be unexported (golint)
    • Line 77: warning: exported type IntParam should have comment or be unexported (golint)
    • Line 83: warning: exported method IntParam.Parse should have comment or be unexported (golint)
    • Line 100: warning: exported type Int32Param should have comment or be unexported (golint)
    • Line 104: warning: exported method Int32Param.Parse should have comment or be unexported (golint)
    • Line 114: warning: exported type FloatParam should have comment or be unexported (golint)
    • Line 118: warning: exported method FloatParam.Parse should have comment or be unexported (golint)
    • Line 127: warning: exported type SecondsParam should have comment or be unexported (golint)
    • Line 131: warning: exported method SecondsParam.Parse should have comment or be unexported (golint)
    • Line 141: warning: exported type RegexpParam should have comment or be unexported (golint)
    • Line 147: warning: exported method RegexpParam.Parse should have comment or be unexported (golint)
    • Line 156: warning: exported type FileParam should have comment or be unexported (golint)
    • Line 162: warning: exported method FileParam.Parse should have comment or be unexported (golint)
    • Line 211: warning: exported type Ipv4Param should have comment or be unexported (golint)
    • Line 215: warning: exported method Ipv4Param.Parse should have comment or be unexported (golint)
    • Line 224: warning: exported type PortParam should have comment or be unexported (golint)
    • Line 228: warning: exported method PortParam.Parse should have comment or be unexported (golint)
    • Line 241: warning: exported type PortListParam should have comment or be unexported (golint)
    • Line 245: warning: exported method PortListParam.Parse should have comment or be unexported (golint)
    • Line 284: warning: exported type EndpointListParam should have comment or be unexported (golint)
    • Line 288: warning: exported method EndpointListParam.Parse should have comment or be unexported (golint)
    • Line 328: warning: exported type MarkBitmaskParam should have comment or be unexported (golint)
    • Line 332: warning: exported method MarkBitmaskParam.Parse should have comment or be unexported (golint)
    • Line 353: warning: exported type OneofListParam should have comment or be unexported (golint)
    • Line 358: warning: exported method OneofListParam.Parse should have comment or be unexported (golint)
    • typha/pkg/calc/async_decoupler.go
    • Line 25: warning: exported function NewSyncerCallbacksDecoupler should have comment or be unexported (golint)
    • Line 31: warning: exported type SyncerCallbacksDecoupler should have comment or be unexported (golint)
    • Line 35: warning: exported method SyncerCallbacksDecoupler.OnStatusUpdated should have comment or be unexported (golint)
    • Line 39: warning: exported method SyncerCallbacksDecoupler.OnUpdates should have comment or be unexported (golint)
    • Line 43: warning: exported method SyncerCallbacksDecoupler.SendTo should have comment or be unexported (golint)
    • Line 47: warning: exported method SyncerCallbacksDecoupler.SendToContext should have comment or be unexported (golint)
    • typha/pkg/k8s/rebalance.go
    • Line 26: warning: exported type MaxConnsAPI should have comment or be unexported (golint)
    • Line 30: warning: exported type K8sAPI should have comment or be unexported (golint)
    • Line 35: warning: exported function PollK8sForConnectionLimit should have comment or be unexported (golint)
    • Line 88: warning: exported function CalculateMaxConnLimit should have comment or be unexported (golint)
    • typha/pkg/calc/validation_filter.go
    • Line 29: warning: exported function NewValidationFilter should have comment or be unexported (golint)
    • Line 35: warning: exported type ValidationFilter should have comment or be unexported (golint)
    • Line 39: warning: exported method ValidationFilter.OnStatusUpdated should have comment or be unexported (golint)
    • Line 44: warning: exported method ValidationFilter.OnUpdates should have comment or be unexported (golint)
    • typha/pkg/calc/node_counter.go
    • Line 26: warning: exported function NewNodeCounter should have comment or be unexported (golint)
    • Line 33: warning: exported type NodeCounter should have comment or be unexported (golint)
    • Line 40: warning: exported method NodeCounter.OnStatusUpdated should have comment or be unexported (golint)
    • Line 49: warning: exported method NodeCounter.OnUpdates should have comment or be unexported (golint)
    • Line 67: warning: exported method NodeCounter.GetNumNodes should have comment or be unexported (golint)
    • typha/pkg/syncproto/sync_proto.go
    • Line 15: warning: package comment should be of the form "Package syncproto ..." (golint)
    • Line 190: warning: exported const DefaultPort should have comment or be unexported (golint)
    • Line 192: warning: exported type Envelope should have comment or be unexported (golint)
    • Line 196: warning: exported type SyncerType should have comment or be unexported (golint)
    • Line 199: warning: exported const SyncerTypeFelix should have comment (or a comment on this block) or be unexported (golint)
    • Line 204: warning: exported type MsgClientHello should have comment or be unexported (golint)
    • Line 213: warning: exported type MsgServerHello should have comment or be unexported (golint)
    • Line 223: warning: exported type MsgSyncStatus should have comment or be unexported (golint)
    • Line 226: warning: exported type MsgPing should have comment or be unexported (golint)
    • Line 229: warning: exported type MsgPong should have comment or be unexported (golint)
    • Line 233: warning: exported type MsgKVs should have comment or be unexported (golint)
    • Line 248: warning: exported function SerializeUpdate should have comment or be unexported (golint)
    • Line 286: warning: exported type SerializedUpdate should have comment or be unexported (golint)
    • Line 295: warning: exported var ErrBadKey should have comment or be unexported (golint)
    • Line 297: warning: exported method SerializedUpdate.ToUpdate should have comment or be unexported (golint)
    • typha/pkg/discovery/discovery.go
    • Line 32: warning: exported var ErrServiceNotReady should have comment or be unexported (golint)
    • Line 44: warning: exported type Option should have comment or be unexported (golint)
    • Line 46: warning: exported function WithAddrOverride should have comment or be unexported (golint)
    • Line 52: warning: exported function WithKubeClient should have comment or be unexported (golint)
    • Line 66: warning: exported function WithKubeService should have comment or be unexported (golint)
    • Line 73: warning: exported function WithKubeServicePortNameOverride should have comment or be unexported (golint)
    • typha/fv-tests/state_recorder.go
    • Line 24: warning: exported function NewRecorder should have comment or be unexported (golint)
    • Line 30: warning: comment on exported type StateRecorder should be of the form "StateRecorder ..." (with optional leading article) (golint)
    • Line 41: warning: exported method StateRecorder.KVs should have comment or be unexported (golint)
    • Line 52: warning: exported method StateRecorder.Status should have comment or be unexported (golint)
    • Line 59: warning: exported method StateRecorder.OnUpdates should have comment or be unexported (golint)
    • Line 77: warning: exported method StateRecorder.OnStatusUpdated 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!