Preparing report...

Report for github.com/rkbalgi/libiso

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


golint50%

Golint is a linter for Go source code.

    • libiso/iso8583/iso8583_bitmap.go
    • Line 11: warning: exported type BitMap should have comment or be unexported (golint)
    • Line 22: warning: exported function NewBitMap should have comment or be unexported (golint)
    • Line 34: warning: exported type BitmappedField should have comment or be unexported (golint)
    • Line 46: warning: exported method BitMap.Def should have comment or be unexported (golint)
    • Line 75: warning: comment on exported method BitMap.IsOn should be of the form "IsOn ..." (golint)
    • Line 82: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 123: warning: exported method BitMap.SetOff should have comment or be unexported (golint)
    • Line 129: warning: exported method BitMap.SetOn should have comment or be unexported (golint)
    • Line 151: warning: exported method BitMap.Parse should have comment or be unexported (golint)
    • Line 189: warning: exported method BitMap.Bytes should have comment or be unexported (golint)
    • Line 243: warning: exported method BitMap.SetId should have comment or be unexported (golint)
    • Line 247: warning: exported method BitMap.GetId should have comment or be unexported (golint)
    • Line 251: warning: exported method BitMap.SetSpec should have comment or be unexported (golint)
    • libiso/v2/iso8583/message.go
    • Line 56: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 72: warning: comment on exported method Message.AllFields should be of the form "AllFields ..." (golint)
    • libiso/iso8583/iso8583_fixed_field.go
    • Line 9: warning: exported type FixedFieldDef should have comment or be unexported (golint)
    • Line 17: warning: comment on exported function NewFixedFieldDef should be of the form "NewFixedFieldDef ..." (golint)
    • Line 28: warning: exported method FixedFieldDef.Def should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method FixedFieldDef.Parse should be of the form "Parse ..." (golint)
    • Line 66: warning: comment on exported method FixedFieldDef.Assemble should be of the form "Assemble ..." (golint)
    • Line 72: warning: exported method FixedFieldDef.IsFixed should have comment or be unexported (golint)
    • Line 76: warning: exported method FixedFieldDef.DataLength should have comment or be unexported (golint)
    • Line 80: warning: exported method FixedFieldDef.EncodedLength should have comment or be unexported (golint)
    • Line 85: warning: exported method FixedFieldDef.SetId should have comment or be unexported (golint)
    • Line 89: warning: exported method FixedFieldDef.GetId should have comment or be unexported (golint)
    • Line 93: warning: exported method FixedFieldDef.SetBitPosition should have comment or be unexported (golint)
    • Line 97: warning: exported method FixedFieldDef.BitPosition should have comment or be unexported (golint)
    • libiso/iso8583/iso8583_field_data.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported type FieldData should have comment or be unexported (golint)
    • Line 17: warning: exported method FieldData.BitmapDef should have comment or be unexported (golint)
    • Line 21: warning: exported method FieldData.Def should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrUnsupportedEncoding should have comment or be unexported (golint)
    • Line 157: warning: comment on exported method FieldData.Bytes should be of the form "Bytes ..." (golint)
    • Line 179: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • libiso/v2/iso8583/crypto_ops.go
    • Line 10: warning: exported method PinGenProps.Generate should have comment or be unexported (golint)
    • Line 27: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 34: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 41: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 48: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • libiso/crypto/pin/crypto_pin_iso0.go
    • Line 10: warning: don't use underscores in Go names; type PinBlock_Iso0 should be PinBlockIso0 (golint)
    • Line 10: warning: exported type PinBlock_Iso0 should have comment or be unexported (golint)
    • Line 14: warning: exported method PinBlock_Iso0.Encrypt should have comment or be unexported (golint)
    • Line 48: warning: exported method PinBlock_Iso0.GetPin should have comment or be unexported (golint)
    • libiso/crypto/pin/crypto_pin_iso3.go
    • Line 10: warning: exported type PinblockIso3 should have comment or be unexported (golint)
    • Line 14: warning: exported method PinblockIso3.Encrypt should have comment or be unexported (golint)
    • Line 42: warning: exported method PinblockIso3.GetPin should have comment or be unexported (golint)
    • libiso/iso8583/iso8583_message.go
    • Line 38: warning: comment on exported method Iso8583Message.ToWebMsg should be of the form "ToWebMsg ..." (golint)
    • Line 160: warning: don't use underscores in Go names; method __init__ should be _Init (golint)
    • Line 220: warning: exported method Iso8583Message.Field should have comment or be unexported (golint)
    • Line 224: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 230: warning: comment on exported method Iso8583Message.SetField should be of the form "SetField ..." (golint)
    • Line 238: warning: comment on exported method Iso8583Message.GetFieldByName should be of the form "GetFieldByName ..." (golint)
    • Line 246: warning: comment on exported function CopyRequestToResponse should be of the form "CopyRequestToResponse ..." (golint)
    • Line 262: warning: comment on exported method Iso8583Message.Dump should be of the form "Dump ..." (golint)
    • Line 298: warning: comment on exported method Iso8583Message.TabularFormat should be of the form "TabularFormat ..." (golint)
    • Line 332: warning: exported type Tuple should have comment or be unexported (golint)
    • Line 337: warning: exported function NewTuple should have comment or be unexported (golint)
    • Line 342: warning: comment on exported method Iso8583Message.Parse should be of the form "Parse ..." (golint)
    • Line 387: warning: exported method Iso8583Message.Bytes should have comment or be unexported (golint)
    • Line 421: warning: exported method Iso8583Message.SetFieldData should have comment or be unexported (golint)
    • Line 425: warning: exported method Iso8583Message.GetFieldDataById should have comment or be unexported (golint)
    • libiso/crypto/mac/x919_mac.go
    • Line 22: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • libiso/crypto/pin/crypto_pin_ibm3264.go
    • Line 9: warning: exported type PinblockIbm3264 should have comment or be unexported (golint)
    • Line 13: warning: exported method PinblockIbm3264.Encrypt should have comment or be unexported (golint)
    • Line 26: warning: exported method PinblockIbm3264.GetPin should have comment or be unexported (golint)
    • libiso/v2/iso8583/spec_file_reader.go
    • Line 15: warning: exported var NumericRegexPattern should have comment or be unexported (golint)
    • Line 49: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • libiso/crypto/crypto_des.go
    • Line 10: warning: exported type DesMode should have comment or be unexported (golint)
    • Line 13: warning: exported const Ecb should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var ZeroIv should have comment or be unexported (golint)
    • Line 21: warning: exported function EncryptTripleDesEde2 should have comment or be unexported (golint)
    • Line 48: warning: exported function DecryptTripleDesEde2 should have comment or be unexported (golint)
    • Line 74: warning: exported function EncryptDes should have comment or be unexported (golint)
    • Line 78: warning: exported function DecryptDes should have comment or be unexported (golint)
    • Line 82: warning: exported function EncryptTripleDes should have comment or be unexported (golint)
    • Line 86: warning: exported function DecryptTripleDes should have comment or be unexported (golint)
    • Line 124: warning: exported function EncryptDesCbc should have comment or be unexported (golint)
    • libiso/crypto/mac/aes_cmac128.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 23: warning: exported const AesBlockSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 104: warning: comment on exported function AesCmac128 should be of the form "AesCmac128 ..." (golint)
    • libiso/iso8583/iso8583_defs.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 23: warning: exported const V1 should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: comment on exported type WebMsgData should be of the form "WebMsgData ..." (with optional leading article) (golint)
    • Line 74: warning: exported type IsoField should have comment or be unexported (golint)
    • Line 91: warning: exported type MessageDef should have comment or be unexported (golint)
    • Line 126: warning: exported method MessageDef.Name should have comment or be unexported (golint)
    • libiso/iso8583/iso8583_json_spec_defs.go
    • Line 27: warning: exported type FieldAttributes should have comment or be unexported (golint)
    • Line 51: warning: exported type JsonSpecDefs should have comment or be unexported (golint)
    • Line 93: warning: exported function ReadSpecDefs should have comment or be unexported (golint)
    • Line 133: warning: exported function ReadSpecDefsFromBuf should have comment or be unexported (golint)
    • libiso/hsm/hsm.go
    • Line 29: warning: exported function NewThalesHsm should have comment or be unexported (golint)
    • Line 39: warning: exported method ThalesHsm.Stop should have comment or be unexported (golint)
    • Line 43: warning: exported method ThalesHsm.Start should have comment or be unexported (golint)
    • libiso/hsm/hsm_constants.go
    • Line 6: warning: comment on exported const String should be of the form "String ..." (golint)
    • Line 8: warning: comment on exported const Binary should be of the form "Binary ..." (golint)
    • Line 10: warning: comment on exported const DecimalInt should be of the form "DecimalInt ..." (golint)
    • Line 12: warning: comment on exported const HexadecimalInt should be of the form "HexadecimalInt ..." (golint)
    • Line 16: warning: exported type EncodingType should have comment or be unexported (golint)
    • Line 21: warning: comment on exported const EbcdicEncoding should be of the form "EbcdicEncoding ..." (golint)
    • libiso/hsm/hsm_helper_funcs.go
    • Line 15: warning: exported const PercentSign should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 105: warning: exported function Dump should have comment or be unexported (golint)
    • libiso/crypto/crypto_padding.go
    • Line 10: warning: comment on exported const Iso9797M1Padding should be of the form "Iso9797M1Padding ..." (golint)
    • Line 12: warning: comment on exported const Iso9797M2Padding should be of the form "Iso9797M2Padding ..." (golint)
    • Line 14: warning: comment on exported const DesBlockSize should be of the form "DesBlockSize ..." (golint)
    • Line 20: warning: exported method PaddingType.Pad should have comment or be unexported (golint)
    • Line 70: warning: exported method PaddingType.RemovePad should have comment or be unexported (golint)
    • libiso/hsm/console/console.go
    • Line 35: warning: exported type Console should have comment or be unexported (golint)
    • Line 40: warning: exported const EXIT should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported function New should have comment or be unexported (golint)
    • Line 48: warning: exported method Console.Show should have comment or be unexported (golint)
    • libiso/net/tcp_ip_host.go
    • Line 11: warning: exported type TcpMessageHandler should have comment or be unexported (golint)
    • Line 15: warning: exported type TcpHost should have comment or be unexported (golint)
    • Line 22: warning: exported function NewTcpHost should have comment or be unexported (golint)
    • Line 32: warning: exported method TcpHost.SetHandler should have comment or be unexported (golint)
    • Line 36: warning: exported method TcpHost.Start should have comment or be unexported (golint)
    • libiso/v2/iso8583/field.go
    • Line 17: warning: comment on exported const Variable should be of the form "Variable ..." (golint)
    • Line 19: warning: comment on exported const Bitmapped should be of the form "Bitmapped ..." (golint)
    • Line 160: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 227: warning: comment on exported method Field.GetChildren should be of the form "GetChildren ..." (golint)
    • libiso/crypto/pin/crypto_pin_iso1.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported type PinblockIso1 should have comment or be unexported (golint)
    • Line 15: warning: exported method PinblockIso1.Encrypt should have comment or be unexported (golint)
    • Line 29: warning: exported method PinblockIso1.GetPin should have comment or be unexported (golint)
    • libiso/cmd/iso_host/iso_host.go
    • Line 19: warning: exported type IsoMessageHandler should have comment or be unexported (golint)
    • Line 23: warning: exported method IsoMessageHandler.HandleMessage should have comment or be unexported (golint)
    • libiso/net/echo_server.go
    • Line 15: warning: exported type EchoServ should have comment or be unexported (golint)
    • Line 22: warning: exported method EchoServ.ListenAndAccept should have comment or be unexported (golint)
    • Line 121: warning: exported function HandleError should have comment or be unexported (golint)
    • libiso/iso8583/iso8583_variable_field.go
    • Line 39: warning: exported method VariableFieldDef.Def should have comment or be unexported (golint)
    • Line 52: warning: exported method VariableFieldDef.Parse should have comment or be unexported (golint)
    • Line 102: warning: comment on exported method VariableFieldDef.Assemble should be of the form "Assemble ..." (golint)
    • Line 107: warning: exported method VariableFieldDef.IsFixed should have comment or be unexported (golint)
    • Line 111: warning: exported method VariableFieldDef.DataLength should have comment or be unexported (golint)
    • Line 116: warning: comment on exported method VariableFieldDef.EncodedLength should be of the form "EncodedLength ..." (golint)
    • Line 202: warning: exported method VariableFieldDef.SetId should have comment or be unexported (golint)
    • Line 206: warning: exported method VariableFieldDef.GetId should have comment or be unexported (golint)
    • Line 215: warning: exported method VariableFieldDef.SetBitPosition should have comment or be unexported (golint)
    • Line 219: warning: exported method VariableFieldDef.BitPosition should have comment or be unexported (golint)
    • libiso/crypto/crypto_keygen.go
    • Line 11: warning: exported var ErrInvalidKeyLength should have comment or be unexported (golint)
    • Line 13: warning: comment on exported function GenerateDesKey should be of the form "GenerateDesKey ..." (golint)
    • libiso/v2/iso8583/types.go
    • Line 9: warning: exported type Specs should have comment or be unexported (golint)
    • Line 13: warning: exported type FieldType should have comment or be unexported (golint)
    • Line 14: warning: exported type Encoding should have comment or be unexported (golint)
    • Line 19: warning: exported type PaddingType should have comment or be unexported (golint)
    • Line 21: warning: exported type PinFormat should have comment or be unexported (golint)
    • Line 22: warning: exported type MacAlgo should have comment or be unexported (golint)
    • Line 25: warning: exported const LeadingZeroes should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported const FixedType should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported method Encoding.EncodeToString should have comment or be unexported (golint)
    • Line 70: warning: exported method Encoding.AsString should have comment or be unexported (golint)
    • Line 104: warning: exported type FieldConstraints should have comment or be unexported (golint)
    • Line 114: warning: exported const HintDateTime should have comment (or a comment on this block) or be unexported (golint)
    • Line 137: warning: exported const ISO0 should have comment (or a comment on this block) or be unexported (golint)
    • Line 144: warning: exported type MacGenProps should have comment or be unexported (golint)
    • Line 149: warning: exported type PinGenProps should have comment or be unexported (golint)
    • libiso/net/net_cat.go
    • Line 9: warning: exported type MliType should have comment or be unexported (golint)
    • Line 12: warning: exported const Mli2i should have comment (or a comment on this block) or be unexported (golint)
    • Line 68: warning: exported method NetCatClient.IsConnected should have comment or be unexported (golint)
    • libiso/hsm/thales_a0_command.go
    • Line 58: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 63: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 68: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 73: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • libiso/hsm/thales_ms_command.go
    • Line 11: warning: exported type ThalesMsRequest should have comment or be unexported (golint)
    • Line 24: warning: exported type ThalesMsResponse should have comment or be unexported (golint)
    • Line 33: warning: exported method ThalesHsm.HandleMS should have comment or be unexported (golint)
    • Line 172: warning: exported method ThalesMsRequest.InvalidDataResponse should have comment or be unexported (golint)
    • libiso/hsm/keyblock/thales_key_block.go
    • Line 4: warning: don't use underscores in Go names; const tag_thales should be tagThales (golint)
    • Line 5: warning: don't use underscores in Go names; const tag_tr31 should be tagTr31 (golint)
    • Line 7: warning: don't use underscores in Go names; const keyblock_version_3des should be keyblockVersion3des (golint)
    • Line 8: warning: don't use underscores in Go names; const keyblock_version_aes should be keyblockVersionAes (golint)
    • Line 11: warning: don't use underscores in Go names; const dek_generic should be dekGeneric (golint)
    • Line 17: warning: don't use underscores in Go names; const mac_iso_16609 should be macIso16609 (golint)
    • Line 18: warning: don't use underscores in Go names; const mac_iso_9791_1_alg1 should be macIso9791_1Alg1 (golint)
    • Line 19: warning: don't use underscores in Go names; const mac_iso_9791_1_alg2 should be macIso9791_1Alg2 (golint)
    • Line 20: warning: don't use underscores in Go names; const mac_iso_9791_1_alg3 should be macIso9791_1Alg3 (golint)
    • Line 21: warning: don't use underscores in Go names; const mac_iso_9791_1_alg4 should be macIso9791_1Alg4 (golint)
    • Line 22: warning: don't use underscores in Go names; const mac_aes_cbc should be macAesCbc (golint)
    • Line 23: warning: don't use underscores in Go names; const mac_aes_cmac should be macAesCmac (golint)
    • Line 28: warning: don't use underscores in Go names; const alg_aes should be algAes (golint)
    • Line 29: warning: don't use underscores in Go names; const alg_des should be algDes (golint)
    • Line 30: warning: don't use underscores in Go names; const alg_3des should be alg3des (golint)
    • Line 31: warning: don't use underscores in Go names; const alg_ecc should be algEcc (golint)
    • Line 32: warning: don't use underscores in Go names; const alg_hmac should be algHmac (golint)
    • Line 33: warning: don't use underscores in Go names; const alg_rsa should be algRsa (golint)
    • Line 34: warning: don't use underscores in Go names; const alg_dsa should be algDsa (golint)
    • Line 37: warning: don't use underscores in Go names; const mode_enc_dec should be modeEncDec (golint)
    • Line 38: warning: don't use underscores in Go names; const mode_mac_gen_ver should be modeMacGenVer (golint)
    • Line 39: warning: don't use underscores in Go names; const mode_dec should be modeDec (golint)
    • Line 40: warning: don't use underscores in Go names; const mode_enc should be modeEnc (golint)
    • Line 41: warning: don't use underscores in Go names; const mode_mac_gen should be modeMacGen (golint)
    • Line 42: warning: don't use underscores in Go names; const mode_all should be modeAll (golint)
    • Line 43: warning: don't use underscores in Go names; const mode_dsig_gen should be modeDsigGen (golint)
    • Line 44: warning: don't use underscores in Go names; const mode_dsig_verify should be modeDsigVerify (golint)
    • Line 47: warning: exported type ThalesKeyBlockHeader should have comment or be unexported (golint)
    • Line 48: warning: don't use underscores in Go names; struct field version_id should be versionID (golint)
    • Line 49: warning: don't use underscores in Go names; struct field key_block_length should be keyBlockLength (golint)
    • Line 50: warning: don't use underscores in Go names; struct field key_usage should be keyUsage (golint)
    • Line 52: warning: don't use underscores in Go names; struct field mode_of_use should be modeOfUse (golint)
    • Line 53: warning: don't use underscores in Go names; struct field key_version should be keyVersion (golint)
    • Line 55: warning: don't use underscores in Go names; struct field n_opt_hdr_blocks should be nOptHdrBlocks (golint)
    • Line 56: warning: don't use underscores in Go names; struct field lmk_id should be lmkID (golint)
    • Line 59: warning: exported type KeyDataBlock should have comment or be unexported (golint)
    • Line 60: warning: don't use underscores in Go names; struct field key_length should be keyLength (golint)
    • Line 65: warning: exported type ThalesKeyBlock should have comment or be unexported (golint)
    • Line 68: warning: don't use underscores in Go names; struct field key_data_block should be keyDataBlock (golint)
    • Line 69: warning: don't use underscores in Go names; struct field key_block_authenticator should be keyBlockAuthenticator (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!