Preparing report...

Report for github.com/cisco-ie/pipeline-gnmi

A    Great!    Found 35 issues across 39 files

Tweet

gofmt97%

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!


golint25%

Golint is a linter for Go source code.

    • pipeline-gnmi/xport_udp.go
    • Line 23: warning: exported const XPORT_UDPPOLLWAIT should have comment (or a comment on this block) or be unexported (golint)
    • Line 288: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/replay.go
    • Line 26: warning: exported const REPLAY_DELAY_DEFAULT_USEC should have comment (or a comment on this block) or be unexported (golint)
    • Line 248: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/crypt.go
    • Line 28: warning: error should be the last type when returning multiple items (golint)
    • Line 28: warning: don't use underscores in Go names; func collect_pkey should be collectPkey (golint)
    • Line 51: warning: error should be the last type when returning multiple items (golint)
    • Line 51: warning: don't use underscores in Go names; func encrypt_password should be encryptPassword (golint)
    • Line 67: warning: error should be the last type when returning multiple items (golint)
    • Line 67: warning: don't use underscores in Go names; func decrypt_password should be decryptPassword (golint)
    • Line 96: warning: error should be the last type when returning multiple items (golint)
    • Line 150: warning: don't use underscores in Go names; var pw_pem should be pwPem (golint)
    • pipeline-gnmi/xport_grpc_out_test.go
    • Line 202: warning: don't use underscores in Go names; func parameter produce_iterations should be produceIterations (golint)
    • Line 296: warning: don't use underscores in Go names; var produce_iterations should be produceIterations (golint)
    • Line 309: warning: don't use underscores in Go names; var produce_iterations should be produceIterations (golint)
    • pipeline-gnmi/xport_kafka.go
    • Line 29: warning: exported const KAFKATOPICDEFAULT should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported const KAFKA_KEY_SPEC_NONE should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: comment on exported const KAFKA_KEY_SPEC_ID_AND_PATH should be of the form "KAFKA_KEY_SPEC_ID_AND_PATH ..." (golint)
    • Line 49: warning: comment on exported const KAFKA_KEY_SPEC_ID should be of the form "KAFKA_KEY_SPEC_ID ..." (golint)
    • Line 112: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 118: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 125: warning: error should be the last type when returning multiple items (golint)
    • Line 358: warning: error should be the last type when returning multiple items (golint)
    • Line 613: warning: don't use underscores in Go names; var checkpoint_flush should be checkpointFlush (golint)
    • Line 614: warning: don't use underscores in Go names; var checkpoint_flush_scheduled should be checkpointFlushScheduled (golint)
    • Line 712: warning: don't use underscores in Go names; var restart_request should be restartRequest (golint)
    • Line 839: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/xport_tcp.go
    • Line 23: warning: comment on exported const XPORT_TCP_WAIT_TO_REBIND should be of the form "XPORT_TCP_WAIT_TO_REBIND ..." (golint)
    • Line 387: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/metrics_influx.go
    • Line 36: warning: comment on exported const METRICS_INFLUX_TIMEOUT_ENQUEUE_SECONDS should be of the form "METRICS_INFLUX_TIMEOUT_ENQUEUE_SECONDS ..." (golint)
    • Line 40: warning: exported const METRICS_INFLUX_WAIT_TO_RECONNECT_SECONDS should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: comment on exported const METRICS_INFLUX_FIELDS_PER_POINT_ESTIMATE should be of the form "METRICS_INFLUX_FIELDS_PER_POINT_ESTIMATE ..." (golint)
    • Line 94: warning: don't use underscores in Go names; var error_tag should be errorTag (golint)
    • Line 361: warning: don't use underscores in Go names; method parameter tag_atoms should be tagAtoms (golint)
    • Line 368: warning: don't use underscores in Go names; range var field_atom should be fieldAtom (golint)
    • Line 373: warning: don't use underscores in Go names; range var tag_atom should be tagAtom (golint)
    • Line 429: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pipeline-gnmi/codec_json.go
    • Line 32: warning: error should be the last type when returning multiple items (golint)
    • Line 59: warning: error should be the last type when returning multiple items (golint)
    • Line 63: warning: error should be the last type when returning multiple items (golint)
    • Line 80: warning: error should be the last type when returning multiple items (golint)
    • Line 88: warning: error should be the last type when returning multiple items (golint)
    • Line 94: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/crypt_test.go
    • Line 28: warning: don't use underscores in Go names; var pemfile_bad should be pemfileBad (golint)
    • Line 53: warning: don't use underscores in Go names; var encoded_cipher should be encodedCipher (golint)
    • pipeline-gnmi/mdt_msg_samples/samples.go
    • Line 9: warning: package comment should be of the form "Package mdt_msg_samples ..." (golint)
    • Line 11: warning: don't use an underscore in package name (golint)
    • Line 27: warning: exported type SampleTelemetryTableEntry should have comment or be unexported (golint)
    • Line 36: warning: exported type SampleTelemetryDatabaseID should have comment or be unexported (golint)
    • Line 39: warning: exported const SAMPLE_TELEMETRY_DATABASE_BASIC should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported function MDTSampleTelemetryTableFetchOne should have comment or be unexported (golint)
    • Line 55: warning: exported type MDTContext should have comment or be unexported (golint)
    • Line 56: warning: exported type MDTSampleCallback should have comment or be unexported (golint)
    • Line 83: warning: exported function MDTLoadMetrics should have comment or be unexported (golint)
    • pipeline-gnmi/codec_gpb_test.go
    • Line 196: warning: receiver name p should be consistent with previous receiver name m for metricsTestOutputHandler (golint)
    • Line 202: warning: receiver name p should be consistent with previous receiver name m for metricsTestOutputHandler (golint)
    • Line 206: warning: receiver name p should be consistent with previous receiver name m for metricsTestOutputHandler (golint)
    • Line 212: warning: receiver name p should be consistent with previous receiver name m for metricsTestOutputHandler (golint)
    • Line 229: warning: receiver name p should be consistent with previous receiver name m for metricsTestOutputHandler (golint)
    • Line 323: warning: don't use underscores in Go names; var map_a should be mapA (golint)
    • Line 324: warning: don't use underscores in Go names; var map_b should be mapB (golint)
    • Line 394: warning: receiver name m should be consistent with previous receiver name g for gpbTestControl (golint)
    • pipeline-gnmi/codec.go
    • Line 48: warning: don't use underscores in Go names; var codec_support should be codecSupport (golint)
    • Line 57: warning: error should be the last type when returning multiple items (golint)
    • Line 103: warning: error should be the last type when returning multiple items (golint)
    • Line 120: warning: don't use underscores in Go names; func codec_init should be codecInit (golint)
    • Line 151: warning: exported type CodecMetaMonitorType should have comment or be unexported (golint)
    • pipeline-gnmi/codec_gpb.go
    • Line 32: warning: exported const GPBCODEC should have comment (or a comment on this block) or be unexported (golint)
    • Line 71: warning: error should be the last type when returning multiple items (golint)
    • Line 75: warning: error should be the last type when returning multiple items (golint)
    • Line 88: warning: don't use underscores in Go names; var node_id should be nodeID (golint)
    • Line 102: warning: error should be the last type when returning multiple items (golint)
    • Line 111: warning: don't use underscores in Go names; func parameter must_be_numeric should be mustBeNumeric (golint)
    • Line 164: warning: don't use underscores in Go names; var existing_entry should be existingEntry (golint)
    • Line 229: warning: don't use underscores in Go names; struct field Node_id should be NodeID (golint)
    • Line 230: warning: don't use underscores in Go names; struct field Encoding_path should be EncodingPath (golint)
    • Line 232: warning: don't use underscores in Go names; struct field collection_id should be collectionID (golint)
    • Line 233: warning: don't use underscores in Go names; struct field collection_start_time should be collectionStartTime (golint)
    • Line 234: warning: don't use underscores in Go names; struct field collection_end_time should be collectionEndTime (golint)
    • Line 235: warning: don't use underscores in Go names; struct field Msg_timestamp should be MsgTimestamp (golint)
    • Line 254: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 484: warning: error should be the last type when returning multiple items (golint)
    • Line 588: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1088: warning: don't use underscores in Go names; method parameter parent_timestamp should be parentTimestamp (golint)
    • Line 1203: warning: error should be the last type when returning multiple items (golint)
    • Line 1218: warning: don't use underscores in Go names; var base_path should be basePath (golint)
    • Line 1242: warning: error should be the last type when returning multiple items (golint)
    • Line 1259: warning: error should be the last type when returning multiple items (golint)
    • Line 1335: warning: error should be the last type when returning multiple items (golint)
    • Line 1372: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/codec_gnmi.go
    • Line 47: warning: error should be the last type when returning multiple items (golint)
    • Line 171: warning: error should be the last type when returning multiple items (golint)
    • Line 175: warning: error should be the last type when returning multiple items (golint)
    • Line 193: warning: error should be the last type when returning multiple items (golint)
    • Line 201: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/message.go
    • Line 52: warning: error should be the last type when returning multiple items (golint)
    • Line 72: warning: error should be the last type when returning multiple items (golint)
    • Line 113: warning: error should be the last type when returning multiple items (golint)
    • Line 201: warning: comment on exported const SHUTDOWN should be of the form "SHUTDOWN ..." (golint)
    • Line 204: warning: comment on exported const REPORT should be of the form "REPORT ..." (golint)
    • Line 206: warning: comment on exported const ACK should be of the form "ACK ..." (golint)
    • pipeline-gnmi/pipeline.go
    • Line 133: warning: comment on exported type ConductorMetaMonitor should be of the form "ConductorMetaMonitor ..." (with optional leading article) (golint)
    • Line 171: warning: comment on exported method ConductorMetaMonitor.Collect should be of the form "Collect ..." (golint)
    • Line 347: warning: exported type ConfigEnvironment should have comment or be unexported (golint)
    • Line 350: warning: exported method ConfigEnvironment.Env should have comment or be unexported (golint)
    • Line 362: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 584: warning: don't use underscores in Go names; var o_data should be oData (golint)
    • Line 584: warning: don't use underscores in Go names; var o_ctrl should be oCtrl (golint)
    • Line 654: warning: don't use underscores in Go names; var i_ctrl should be iCtrl (golint)
    • pipeline-gnmi/xport_grpc_test.go
    • Line 73: warning: don't use underscores in Go names; var tls_pem should be tlsPem (golint)
    • Line 74: warning: don't use underscores in Go names; var tls_key should be tlsKey (golint)
    • Line 75: warning: don't use underscores in Go names; var tls_servername should be tlsServername (golint)
    • pipeline-gnmi/encap_st.go
    • Line 19: warning: exported const ENC_ST_MAX_DGRAM should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported const ENC_ST_HDR_MSG_TYPE_UNSED should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported const ENC_ST_HDR_MSG_ENCAP_UNSED should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported const ENC_ST_WAIT_FOR_HDR should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: error should be the last type when returning multiple items (golint)
    • Line 91: warning: error should be the last type when returning multiple items (golint)
    • Line 125: warning: error should be the last type when returning multiple items (golint)
    • Line 196: warning: error should be the last type when returning multiple items (golint)
    • pipeline-gnmi/message_router_test.go
    • Line 23: warning: don't use underscores in Go names; var last_attempts should be lastAttempts (golint)
    • Line 46: warning: don't use underscores in Go names; var msg_router should be msgRouter (golint)
    • Line 133: warning: don't use underscores in Go names; var w_handled should be wHandled (golint)
    • pipeline-gnmi/xport_grpc.go
    • Line 40: warning: exported const XPORT_GRPC_WAIT_TO_REDIAL should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: comment on exported const GRPC_ENCODE_GPB should be of the form "GRPC_ENCODE_GPB ..." (golint)
    • Line 49: warning: comment on exported const GRPCLOGPRE should be of the form "GRPCLOGPRE ..." (golint)
    • Line 53: warning: error should be the last type when returning multiple items (golint)
    • Line 84: warning: don't use underscores in Go names; struct field tls_pem should be tlsPem (golint)
    • Line 85: warning: don't use underscores in Go names; struct field tls_key should be tlsKey (golint)
    • Line 86: warning: don't use underscores in Go names; struct field tls_servername should be tlsServername (golint)
    • Line 285: warning: receiver name server should be consistent with previous receiver name s for grpcRemoteServer (golint)
    • Line 407: warning: don't use underscores in Go names; struct field control_ctx should be controlCtx (golint)
    • Line 470: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 537: warning: receiver name server should be consistent with previous receiver name s for grpcLocalServer (golint)
    • Line 733: warning: error should be the last type when returning multiple items (golint)
    • Line 767: warning: error should be the last type when returning multiple items (golint)
    • Line 782: warning: error should be the last type when returning multiple items (golint)
    • Line 804: warning: don't use underscores in Go names; var tls_pem should be tlsPem (golint)
    • Line 805: warning: don't use underscores in Go names; var tls_servername should be tlsServername (golint)
    • Line 806: warning: don't use underscores in Go names; var tls_key should be tlsKey (golint)
    • pipeline-gnmi/xport_grpc_out.go
    • Line 21: warning: comment on exported const DRAINTIMEOUT should be of the form "DRAINTIMEOUT ..." (golint)
    • Line 40: warning: don't use underscores in Go names; struct field tls_pem should be tlsPem (golint)
    • Line 41: warning: don't use underscores in Go names; struct field tls_key should be tlsKey (golint)
    • Line 42: warning: don't use underscores in Go names; struct field tls_servername should be tlsServername (golint)
    • Line 129: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 459: warning: error should be the last type when returning multiple items (golint)

gocyclo58%

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.

    • pipeline-gnmi/xport_kafka.go
    • Line 592: warning: cyclomatic complexity 32 of function (*kafkaInputModule).maintainKafkaConsumerConnection() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 18 of function (*kafkaOutputModule).configure() is high (> 15) (gocyclo)
    • pipeline-gnmi/jsonpb.go
    • Line 698: warning: cyclomatic complexity 98 of function (*Unmarshaler).unmarshalValue() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 57 of function (*Marshaler).marshalObject() is high (> 15) (gocyclo)
    • Line 474: warning: cyclomatic complexity 40 of function (*Marshaler).marshalValue() is high (> 15) (gocyclo)
    • Line 1131: warning: cyclomatic complexity 33 of function checkRequiredFields() is high (> 15) (gocyclo)
    • pipeline-gnmi/tap.go
    • Line 41: warning: cyclomatic complexity 25 of function (*tapOutputModule).tapOutputFeederLoop() is high (> 15) (gocyclo)
    • pipeline-gnmi/codec_gpb.go
    • Line 930: warning: cyclomatic complexity 19 of function (*dataMsgGPB).produceGPBMetricsForNode() is high (> 15) (gocyclo)
    • Line 605: warning: cyclomatic complexity 18 of function (*dataMsgGPB).produceGPBKVMetricsForNode() is high (> 15) (gocyclo)
    • pipeline-gnmi/replay.go
    • Line 53: warning: cyclomatic complexity 25 of function (*replayInputModule).replayInputFeederLoop() is high (> 15) (gocyclo)

ineffassign82%

IneffAssign detects ineffectual assignments in Go code.

    • pipeline-gnmi/xport_kafka_test.go
    • Line 71: warning: ineffectual assignment to err (ineffassign)
    • Line 78: warning: ineffectual assignment to err (ineffassign)
    • Line 89: warning: ineffectual assignment to err (ineffassign)
    • Line 121: warning: ineffectual assignment to err (ineffassign)
    • Line 167: warning: ineffectual assignment to err (ineffassign)
    • Line 254: warning: ineffectual assignment to err (ineffassign)
    • Line 268: warning: ineffectual assignment to ctrl (ineffassign)
    • Line 274: warning: ineffectual assignment to err (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!