Preparing report...

Report for github.com/openconfig/gnmi-gateway

A+    Excellent!    Found 25 issues across 39 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.


golint35%

Golint is a linter for Go source code.

    • gnmi-gateway/gateway/connections/zookeeper.go
    • Line 35: warning: exported type ZookeeperConnectionManager should have comment or be unexported (golint)
    • Line 76: warning: exported method ZookeeperConnectionManager.Cache should have comment or be unexported (golint)
    • Line 104: warning: exported method ZookeeperConnectionManager.TargetControlChan should have comment or be unexported (golint)
    • Line 184: warning: exported method ZookeeperConnectionManager.Start should have comment or be unexported (golint)
    • Line 189: warning: exported function MakeTargetLockPath should have comment or be unexported (golint)
    • gnmi-gateway/gateway/configuration/config.go
    • Line 109: warning: exported type ExportersConfig should have comment or be unexported (golint)
    • Line 145: warning: exported type TargetLoadersConfig should have comment or be unexported (golint)
    • Line 186: warning: exported function NewDefaultGatewayConfig should have comment or be unexported (golint)
    • Line 195: warning: exported function NewGatewayConfigFromFile should have comment or be unexported (golint)
    • Line 204: warning: exported function PopulateGatewayConfigFromFile should have comment or be unexported (golint)
    • gnmi-gateway/gateway/loaders/loader.go
    • Line 27: warning: exported var Registry should have comment or be unexported (golint)
    • Line 43: warning: exported function Register should have comment or be unexported (golint)
    • Line 47: warning: exported function New should have comment or be unexported (golint)
    • gnmi-gateway/gateway/exporters/kafka/kafka.go
    • Line 34: warning: exported const Name should have comment or be unexported (golint)
    • Line 42: warning: exported function NewKafkaExporter should have comment or be unexported (golint)
    • Line 48: warning: exported type KafkaExporter should have comment or be unexported (golint)
    • Line 54: warning: exported method KafkaExporter.Name should have comment or be unexported (golint)
    • Line 58: warning: exported method KafkaExporter.Export should have comment or be unexported (golint)
    • Line 78: warning: exported method KafkaExporter.Start should have comment or be unexported (golint)
    • gnmi-gateway/gateway/stats/spectator.go
    • Line 27: warning: exported var Registry should have comment or be unexported (golint)
    • Line 28: warning: exported var NoTags should have comment or be unexported (golint)
    • Line 39: warning: exported type Spectator should have comment or be unexported (golint)
    • Line 44: warning: exported function StartSpectator should have comment or be unexported (golint)
    • Line 82: warning: exported function DefaultSpectatorConfig should have comment or be unexported (golint)
    • Line 92: warning: exported type SpectatorLogger should have comment or be unexported (golint)
    • Line 96: warning: exported function NewSpectatorLogger should have comment or be unexported (golint)
    • Line 100: warning: exported method SpectatorLogger.Debugf should have comment or be unexported (golint)
    • Line 104: warning: exported method SpectatorLogger.Infof should have comment or be unexported (golint)
    • Line 108: warning: exported method SpectatorLogger.Errorf should have comment or be unexported (golint)
    • gnmi-gateway/gateway/locking/local.go
    • Line 36: warning: exported function NewNonBlockingLock should have comment or be unexported (golint)
    • Line 43: warning: exported method NonBlockingLock.GetMember should have comment or be unexported (golint)
    • Line 51: warning: exported method NonBlockingLock.ID should have comment or be unexported (golint)
    • Line 55: warning: exported method NonBlockingLock.Try should have comment or be unexported (golint)
    • Line 68: warning: exported method NonBlockingLock.Unlock should have comment or be unexported (golint)
    • gnmi-gateway/gateway/loaders/simple/simple.go
    • Line 59: warning: exported type TargetConfig should have comment or be unexported (golint)
    • Line 64: warning: exported type ConnectionConfig should have comment or be unexported (golint)
    • Line 71: warning: exported type RequestConfig should have comment or be unexported (golint)
    • Line 76: warning: exported type CredentialsConfig should have comment or be unexported (golint)
    • Line 81: warning: exported type SimpleTargetLoader should have comment or be unexported (golint)
    • Line 92: warning: exported function NewSimpleTargetLoader should have comment or be unexported (golint)
    • Line 100: warning: exported method SimpleTargetLoader.GetConfiguration should have comment or be unexported (golint)
    • Line 173: warning: exported method SimpleTargetLoader.Start should have comment or be unexported (golint)
    • Line 178: warning: exported method SimpleTargetLoader.WatchConfiguration should have comment or be unexported (golint)
    • gnmi-gateway/gateway/loaders/cluster/cluster.go
    • Line 36: warning: exported function NewClusterTargetLoader should have comment or be unexported (golint)
    • Line 43: warning: exported method ClusterTargetLoader.GetConfiguration should have comment or be unexported (golint)
    • Line 82: warning: exported method ClusterTargetLoader.Start should have comment or be unexported (golint)
    • Line 86: warning: exported method ClusterTargetLoader.WatchConfiguration should have comment or be unexported (golint)
    • gnmi-gateway/gateway/locking/zookeeper.go
    • Line 56: warning: exported type ZookeeperNonBlockingLock should have comment or be unexported (golint)
    • Line 80: warning: exported function GetMember should have comment or be unexported (golint)
    • Line 96: warning: exported method ZookeeperNonBlockingLock.GetMember should have comment or be unexported (golint)
    • Line 100: warning: exported method ZookeeperNonBlockingLock.ID should have comment or be unexported (golint)
    • Line 109: warning: exported method ZookeeperNonBlockingLock.Try should have comment or be unexported (golint)
    • gnmi-gateway/gateway/loaders/netbox/netbox.go
    • Line 39: warning: exported const Name should have comment or be unexported (golint)
    • Line 43: warning: exported type NetBoxTargetLoader should have comment or be unexported (golint)
    • Line 56: warning: exported function NewNetBoxTargetLoader should have comment or be unexported (golint)
    • Line 65: warning: exported method NetBoxTargetLoader.GetConfiguration should have comment or be unexported (golint)
    • Line 133: warning: exported method NetBoxTargetLoader.Start should have comment or be unexported (golint)
    • Line 143: warning: exported method NetBoxTargetLoader.WatchConfiguration should have comment or be unexported (golint)
    • gnmi-gateway/gateway/exporters/prometheus/prometheus.go
    • Line 37: warning: exported const Name should have comment or be unexported (golint)
    • Line 45: warning: exported function NewPrometheusExporter should have comment or be unexported (golint)
    • Line 54: warning: exported type PrometheusExporter should have comment or be unexported (golint)
    • Line 62: warning: exported method PrometheusExporter.Name should have comment or be unexported (golint)
    • Line 66: warning: exported method PrometheusExporter.Export should have comment or be unexported (golint)
    • Line 112: warning: exported method PrometheusExporter.Start should have comment or be unexported (golint)
    • Line 149: warning: exported function UpdateToMetricNameAndLabels should have comment or be unexported (golint)
    • gnmi-gateway/gateway/gateway.go
    • Line 66: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 100: warning: exported var CPUProfile should have comment or be unexported (golint)
    • Line 105: warning: exported type Gateway should have comment or be unexported (golint)
    • Line 115: warning: exported type CacheClient should have comment or be unexported (golint)
    • Line 154: warning: exported method CacheClient.Send should have comment or be unexported (golint)
    • Line 174: warning: comment on exported method Gateway.AddClient should be of the form "AddClient ..." (golint)
    • Line 395: warning: exported type ZKLogger should have comment or be unexported (golint)
    • Line 399: warning: exported method ZKLogger.Printf should have comment or be unexported (golint)
    • Line 403: warning: exported method Gateway.ConnectToZookeeper should have comment or be unexported (golint)
    • gnmi-gateway/gateway/clustering/zookeeper.go
    • Line 28: warning: exported const ClusterMemberPath should have comment or be unexported (golint)
    • Line 29: warning: exported const DefaultACLPerms should have comment or be unexported (golint)
    • Line 31: warning: exported type ZookeeperClusterMember should have comment or be unexported (golint)
    • Line 39: warning: exported function NewZookeeperClusterMember should have comment or be unexported (golint)
    • Line 48: warning: exported method ZookeeperClusterMember.MemberID should have comment or be unexported (golint)
    • Line 77: warning: exported method ZookeeperClusterMember.MemberListCallback should have comment or be unexported (golint)
    • Line 150: warning: exported method ZookeeperClusterMember.MemberList should have comment or be unexported (golint)
    • Line 168: warning: exported method ZookeeperClusterMember.Unregister should have comment or be unexported (golint)
    • Line 173: warning: exported function CreateParentPath should have comment or be unexported (golint)
    • Line 178: warning: exported function CreatePath should have comment or be unexported (golint)
    • Line 207: warning: exported function CleanPath should have comment or be unexported (golint)
    • gnmi-gateway/gateway/openconfig/types.go
    • Line 46: warning: exported type TypeLookup 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)
    • Line 72: warning: comment on exported method TypeLookup.LoadAllModules should be of the form "LoadAllModules ..." (golint)
    • gnmi-gateway/gateway/exporters/influxdb/influxdb.go
    • Line 31: warning: exported const Name should have comment or be unexported (golint)
    • Line 35: warning: exported type Point should have comment or be unexported (golint)
    • Line 46: warning: exported function NewInfluxDBExporter should have comment or be unexported (golint)
    • Line 53: warning: exported type InfluxDBExporter should have comment or be unexported (golint)
    • Line 59: warning: exported method InfluxDBExporter.Name should have comment or be unexported (golint)
    • Line 63: warning: exported method InfluxDBExporter.Export should have comment or be unexported (golint)
    • Line 135: warning: exported method InfluxDBExporter.Start should have comment or be unexported (golint)
    • Line 141: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • gnmi-gateway/gateway/loaders/json/json.go
    • Line 34: warning: exported type JSONFileTargetLoader should have comment or be unexported (golint)
    • Line 45: warning: exported function NewJSONFileTargetLoader should have comment or be unexported (golint)
    • Line 53: warning: exported method JSONFileTargetLoader.GetConfiguration should have comment or be unexported (golint)
    • Line 73: warning: exported method JSONFileTargetLoader.Start should have comment or be unexported (golint)
    • Line 77: warning: exported method JSONFileTargetLoader.WatchConfiguration should have comment or be unexported (golint)
    • gnmi-gateway/gateway/exporters/prometheus/delta.go
    • Line 25: warning: exported function NewDeltaCalculator should have comment or be unexported (golint)
    • Line 31: warning: exported type DeltaCalculator should have comment or be unexported (golint)
    • Line 36: warning: comment on exported method DeltaCalculator.Calc should be of the form "Calc ..." (golint)
    • Line 45: warning: exported type Hash should have comment or be unexported (golint)
    • Line 47: warning: exported function NewStringMapHash should have comment or be unexported (golint)
    • gnmi-gateway/gateway/exporters/debug/debug.go
    • Line 30: warning: exported const Name should have comment or be unexported (golint)
    • Line 38: warning: exported function NewDebugExporter should have comment or be unexported (golint)
    • Line 45: warning: exported type DebugExporter should have comment or be unexported (golint)
    • Line 50: warning: exported method DebugExporter.Name should have comment or be unexported (golint)
    • Line 54: warning: exported method DebugExporter.Export should have comment or be unexported (golint)
    • Line 59: warning: exported method DebugExporter.Start 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!