Preparing report...

Report for github.com/gemalto/kmip-go

A+    Excellent!    Found 22 issues across 38 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!


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.

    • kmip-go/ttlv/ttlv.go
    • Line 578: warning: cyclomatic complexity 68 of function (*TTLV).unmarshalJSON() is high (> 15) (gocyclo)
    • Line 430: warning: cyclomatic complexity 34 of function unmarshalXMLTval() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 33 of function (TTLV).MarshalJSON() is high (> 15) (gocyclo)
    • Line 312: warning: cyclomatic complexity 26 of function (TTLV).MarshalXML() is high (> 15) (gocyclo)
    • Line 962: warning: cyclomatic complexity 22 of function Print() is high (> 15) (gocyclo)
    • kmip-go/ttlv/encoder.go
    • Line 293: warning: cyclomatic complexity 63 of function (*Encoder).encode() is high (> 15) (gocyclo)
    • Line 738: warning: cyclomatic complexity 23 of function getFieldInfo() is high (> 15) (gocyclo)

golint42%

Golint is a linter for Go source code.

    • kmip-go/ttlv/ttlv.go
    • Line 32: warning: exported var ErrValueTruncated should have comment or be unexported (golint)
    • Line 33: warning: exported var ErrHeaderTruncated should have comment or be unexported (golint)
    • Line 34: warning: exported var ErrInvalidLen should have comment or be unexported (golint)
    • Line 35: warning: exported var ErrInvalidType should have comment or be unexported (golint)
    • Line 36: warning: exported var ErrInvalidTag should have comment or be unexported (golint)
    • Line 156: warning: comment on exported method TTLV.ValueInteger should be of the form "ValueInteger ..." (golint)
    • Line 164: warning: exported method TTLV.ValueLongInteger should have comment or be unexported (golint)
    • Line 168: warning: exported method TTLV.ValueBigInteger should have comment or be unexported (golint)
    • Line 174: warning: exported method TTLV.ValueEnumeration should have comment or be unexported (golint)
    • Line 178: warning: exported method TTLV.ValueBoolean should have comment or be unexported (golint)
    • Line 182: warning: exported method TTLV.ValueTextString should have comment or be unexported (golint)
    • Line 188: warning: exported method TTLV.ValueByteString should have comment or be unexported (golint)
    • Line 192: warning: exported method TTLV.ValueDateTime should have comment or be unexported (golint)
    • Line 200: warning: exported method TTLV.ValueDateTimeExtended should have comment or be unexported (golint)
    • Line 208: warning: exported method TTLV.ValueInterval should have comment or be unexported (golint)
    • Line 294: warning: exported method TTLV.Next should have comment or be unexported (golint)
    • Line 312: warning: exported method TTLV.MarshalXML should have comment or be unexported (golint)
    • Line 554: warning: exported method TTLV.UnmarshalXML should have comment or be unexported (golint)
    • Line 574: warning: exported method TTLV.UnmarshalJSON should have comment or be unexported (golint)
    • Line 811: warning: exported method TTLV.MarshalJSON should have comment or be unexported (golint)
    • kmip-go/base_objects.go
    • Line 35: warning: exported function NewAttributeFromTag should have comment or be unexported (golint)
    • Line 403: warning: exported type TemplateAttribute should have comment or be unexported (golint)
    • Line 449: warning: exported method TemplateAttribute.GetAll should have comment or be unexported (golint)
    • Line 463: warning: exported method TemplateAttribute.Append should have comment or be unexported (golint)
    • Line 467: warning: exported method TemplateAttribute.GetAllTag should have comment or be unexported (golint)
    • kmip-go/errors.go
    • Line 10: warning: exported function Details should have comment or be unexported (golint)
    • Line 14: warning: exported var ErrInvalidTag should have comment or be unexported (golint)
    • Line 27: warning: exported function WithResultReason should have comment or be unexported (golint)
    • Line 31: warning: exported function GetResultReason should have comment or be unexported (golint)
    • kmip-go/types.go
    • Line 3: warning: exported type Authentication should have comment or be unexported (golint)
    • Line 7: warning: exported type Nonce should have comment or be unexported (golint)
    • Line 12: warning: exported type ProtocolVersion should have comment or be unexported (golint)
    • Line 17: warning: exported type MessageExtension should have comment or be unexported (golint)
    • Line 23: warning: exported type Attributes should have comment or be unexported (golint)
    • kmip-go/types_messages.go
    • Line 10: warning: exported type RequestMessage should have comment or be unexported (golint)
    • Line 15: warning: exported type ResponseMessage should have comment or be unexported (golint)
    • Line 22: warning: exported type RequestHeader should have comment or be unexported (golint)
    • Line 37: warning: exported type RequestBatchItem should have comment or be unexported (golint)
    • Line 44: warning: exported type ResponseHeader should have comment or be unexported (golint)
    • Line 54: warning: exported type ResponseBatchItem should have comment or be unexported (golint)
    • kmip-go/ttlv/encoder.go
    • Line 19: warning: exported var ErrIntOverflow should have comment or be unexported (golint)
    • Line 20: warning: exported var ErrUnsupportedEnumTypeError should have comment or be unexported (golint)
    • Line 21: warning: exported var ErrUnsupportedTypeError should have comment or be unexported (golint)
    • Line 22: warning: exported var ErrNoTag should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrTagConflict should have comment or be unexported (golint)
    • Line 111: warning: exported function NewEncoder should have comment or be unexported (golint)
    • Line 145: warning: comment on exported method Encoder.EncodeEnumeration should be of the form "EncodeEnumeration ..." (golint)
    • Line 152: warning: exported method Encoder.EncodeInteger should have comment or be unexported (golint)
    • Line 156: warning: exported method Encoder.EncodeLongInteger should have comment or be unexported (golint)
    • Line 160: warning: exported method Encoder.EncodeInterval should have comment or be unexported (golint)
    • Line 164: warning: exported method Encoder.EncodeDateTime should have comment or be unexported (golint)
    • Line 168: warning: exported method Encoder.EncodeDateTimeExtended should have comment or be unexported (golint)
    • Line 172: warning: exported method Encoder.EncodeBigInteger should have comment or be unexported (golint)
    • Line 176: warning: exported method Encoder.EncodeBoolean should have comment or be unexported (golint)
    • Line 180: warning: exported method Encoder.EncodeTextString should have comment or be unexported (golint)
    • Line 184: warning: exported method Encoder.EncodeByteString should have comment or be unexported (golint)
    • Line 198: warning: exported type MarshalerError should have comment or be unexported (golint)
    • kmip-go/attributes.go
    • Line 22: warning: comment on exported type CryptographicParameters should be of the form "CryptographicParameters ..." (with optional leading article) (golint)
    • kmip-go/op_register.go
    • Line 13: warning: exported type RegisterRequestPayload should have comment or be unexported (golint)
    • Line 28: warning: exported type RegisterResponsePayload should have comment or be unexported (golint)
    • Line 33: warning: exported type RegisterHandler should have comment or be unexported (golint)
    • Line 38: warning: exported method RegisterHandler.HandleItem should have comment or be unexported (golint)
    • kmip-go/ttlv/decoder.go
    • Line 12: warning: exported var ErrUnexpectedValue should have comment or be unexported (golint)
    • Line 159: warning: exported function NewDecoder should have comment or be unexported (golint)
    • Line 458: warning: exported type UnmarshalerError should have comment or be unexported (golint)
    • kmip-go/requests.go
    • Line 539: warning: exported method Request.DecodePayload should have comment or be unexported (golint)
    • Line 565: warning: exported type ResponseWriter should have comment or be unexported (golint)
    • Line 596: warning: exported type ProtocolHandlerFunc should have comment or be unexported (golint)
    • Line 598: warning: exported method ProtocolHandlerFunc.ServeKMIP should have comment or be unexported (golint)
    • Line 602: warning: exported type MessageHandlerFunc should have comment or be unexported (golint)
    • Line 604: warning: exported method MessageHandlerFunc.HandleMessage should have comment or be unexported (golint)
    • Line 608: warning: exported type ItemHandlerFunc should have comment or be unexported (golint)
    • Line 610: warning: exported method ItemHandlerFunc.HandleItem should have comment or be unexported (golint)
    • Line 614: warning: exported var DefaultProtocolHandler should have comment or be unexported (golint)
    • Line 622: warning: exported var DefaultOperationMux should have comment or be unexported (golint)
    • Line 659: warning: exported type Response should have comment or be unexported (golint)
    • Line 687: warning: exported method Response.Bytes should have comment or be unexported (golint)
    • Line 766: warning: exported method StandardProtocolHandler.ServeKMIP should have comment or be unexported (golint)
    • Line 820: warning: exported type ErrorHandlerFunc should have comment or be unexported (golint)
    • Line 822: warning: exported method ErrorHandlerFunc.HandleError should have comment or be unexported (golint)
    • Line 874: warning: exported method OperationMux.HandleMessage should have comment or be unexported (golint)
    • Line 884: warning: exported method OperationMux.Handle should have comment or be unexported (golint)
    • kmip-go/ttlv/tag.go
    • Line 3: warning: exported const TagNone should have comment or be unexported (golint)
    • Line 7: warning: comment on exported type Tag should be of the form "Tag ..." (with optional leading article) (golint)
    • Line 21: warning: exported method Tag.MarshalText should have comment or be unexported (golint)
    • Line 25: warning: exported method Tag.UnmarshalText should have comment or be unexported (golint)
    • kmip-go/ttlv/types.go
    • Line 8: warning: exported function RegisterTypes should have comment or be unexported (golint)
    • Line 33: warning: exported const TypeStructure should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: exported method Type.MarshalText should have comment or be unexported (golint)
    • Line 58: warning: exported method Type.UnmarshalText should have comment or be unexported (golint)
    • Line 68: warning: exported method DateTimeExtended.UnmarshalTTLV should have comment or be unexported (golint)
    • Line 84: warning: exported method DateTimeExtended.MarshalTTLV should have comment or be unexported (golint)
    • Line 174: warning: exported type Encoder should have comment or be unexported (golint)
    • Line 188: warning: exported method EnumValue.MarshalTTLV should have comment or be unexported (golint)
    • kmip-go/cmd/ppkmip/main.go
    • Line 21: warning: exported const FormatJSON should have comment or be unexported (golint)
    • Line 22: warning: exported const FormatXML should have comment or be unexported (golint)
    • Line 23: warning: exported const FormatHex should have comment or be unexported (golint)
    • kmip-go/managed_objects.go
    • Line 12: warning: exported type Certificate should have comment or be unexported (golint)
    • Line 19: warning: exported type SymmetricKey should have comment or be unexported (golint)
    • Line 25: warning: exported type PublicKey should have comment or be unexported (golint)
    • Line 31: warning: exported type PrivateKey should have comment or be unexported (golint)
    • Line 37: warning: exported type SplitKey should have comment or be unexported (golint)
    • Line 48: warning: exported type Template should have comment or be unexported (golint)
    • Line 54: warning: exported type SecretData should have comment or be unexported (golint)
    • Line 61: warning: exported type OpaqueObject should have comment or be unexported (golint)
    • Line 68: warning: exported type PGPKey should have comment or be unexported (golint)
    • kmip-go/op_create.go
    • Line 42: warning: exported type CreateHandler should have comment or be unexported (golint)
    • Line 46: warning: exported method CreateHandler.HandleItem should have comment or be unexported (golint)
    • kmip-go/op_create_key_pair.go
    • Line 3: warning: comment on exported type CreateKeyPairRequestPayload should be of the form "CreateKeyPairRequestPayload ..." (with optional leading article) (golint)
    • Line 33: warning: exported type CreateKeyPairResponsePayload should have comment or be unexported (golint)
    • kmip-go/kmip20/payloads.go
    • Line 5: warning: exported type Attributes should have comment or be unexported (golint)
    • Line 9: warning: exported type CreateRequestPayload should have comment or be unexported (golint)
    • Line 16: warning: exported type CreateResponsePayload should have comment or be unexported (golint)
    • Line 21: warning: exported type CreateKeyPairRequestPayload should have comment or be unexported (golint)
    • Line 30: warning: exported type CreateKeyPairResponsePayload should have comment or be unexported (golint)
    • kmip-go/kmip20/unique_identifier.go
    • Line 8: warning: exported type UniqueIdentifierValue should have comment or be unexported (golint)
    • Line 14: warning: exported method UniqueIdentifierValue.UnmarshalTTLV should have comment or be unexported (golint)
    • Line 37: warning: exported method UniqueIdentifierValue.MarshalTTLV should have comment or be unexported (golint)
    • kmip-go/internal/kmiputil/hex_values.go
    • Line 10: warning: exported var ErrInvalidHexString should have comment or be unexported (golint)
    • Line 12: warning: exported function DecodeUint32 should have comment or be unexported (golint)
    • Line 17: warning: exported function DecodeUint64 should have comment or be unexported (golint)
    • kmip-go/op_discover_versions.go
    • Line 9: warning: exported type DiscoverVersionsRequestPayload should have comment or be unexported (golint)
    • Line 13: warning: exported type DiscoverVersionsResponsePayload should have comment or be unexported (golint)
    • Line 17: warning: exported type DiscoverVersionsHandler should have comment or be unexported (golint)
    • Line 21: warning: exported method DiscoverVersionsHandler.HandleItem should have comment or be unexported (golint)
    • kmip-go/ttlv/registry.go
    • Line 22: warning: exported var ErrInvalidHexString should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrUnregisteredEnumName should have comment or be unexported (golint)
    • Line 60: warning: exported function NewEnum should have comment or be unexported (golint)
    • Line 64: warning: exported function NewBitmask should have comment or be unexported (golint)
    • Line 87: warning: exported method Enum.Name should have comment or be unexported (golint)
    • Line 95: warning: exported method Enum.CanonicalName should have comment or be unexported (golint)
    • Line 103: warning: exported method Enum.Value should have comment or be unexported (golint)
    • Line 114: warning: exported method Enum.Values should have comment or be unexported (golint)
    • Line 124: warning: exported method Enum.Bitmask should have comment or be unexported (golint)
    • Line 140: warning: exported method Registry.RegisterType should have comment or be unexported (golint)
    • Line 144: warning: exported method Registry.RegisterTag should have comment or be unexported (golint)
    • Line 148: warning: exported method Registry.RegisterEnum should have comment or be unexported (golint)
    • Line 164: warning: exported method Registry.IsBitmask should have comment or be unexported (golint)
    • Line 171: warning: exported method Registry.IsEnum should have comment or be unexported (golint)
    • Line 178: warning: exported method Registry.Tags should have comment or be unexported (golint)
    • Line 182: warning: exported method Registry.Types should have comment or be unexported (golint)
    • Line 186: warning: exported method Registry.FormatEnum should have comment or be unexported (golint)
    • Line 190: warning: exported method Registry.FormatInt should have comment or be unexported (golint)
    • Line 194: warning: exported method Registry.FormatTag should have comment or be unexported (golint)
    • Line 198: warning: exported method Registry.FormatTagCanonical should have comment or be unexported (golint)
    • Line 202: warning: exported method Registry.FormatType should have comment or be unexported (golint)
    • Line 206: warning: exported method Registry.ParseEnum should have comment or be unexported (golint)
    • Line 210: warning: exported method Registry.ParseInt should have comment or be unexported (golint)
    • Line 214: warning: comment on exported method Registry.ParseTag should be of the form "ParseTag ..." (golint)
    • Line 220: warning: exported method Registry.ParseType should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!