Preparing report...

Report for github.com/jpki/myna

A+    Excellent!    Found 21 issues across 33 files

Tweet

gofmt96%

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!


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.

    • myna/asn1/asn1.go
    • Line 659: warning: cyclomatic complexity 102 of function parseField() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 18 of function isPrintable() is high (> 15) (gocyclo)
    • myna/asn1/marshal.go
    • Line 532: warning: cyclomatic complexity 38 of function makeField() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 34 of function makeBody() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • myna/libmyna/text_ap.go
    • Line 10: warning: exported type TextAP should have comment or be unexported (golint)
    • Line 14: warning: exported type TextAttrs should have comment or be unexported (golint)
    • Line 22: warning: exported type TextSignature should have comment or be unexported (golint)
    • Line 28: warning: exported type TextCertificate should have comment or be unexported (golint)
    • Line 32: warning: exported type TextBasicInfo should have comment or be unexported (golint)
    • Line 37: warning: exported method TextAP.LookupPin should have comment or be unexported (golint)
    • Line 37: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 46: warning: exported method TextAP.VerifyPin should have comment or be unexported (golint)
    • Line 46: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 55: warning: exported method TextAP.LookupPinA should have comment or be unexported (golint)
    • Line 55: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 64: warning: exported method TextAP.VerifyPinA should have comment or be unexported (golint)
    • Line 64: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 73: warning: exported method TextAP.LookupPinB should have comment or be unexported (golint)
    • Line 73: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 82: warning: exported method TextAP.VerifyPinB should have comment or be unexported (golint)
    • Line 82: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 91: warning: exported method TextAP.ReadMyNumber should have comment or be unexported (golint)
    • Line 91: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 105: warning: exported method TextAP.ReadAttributes should have comment or be unexported (golint)
    • Line 105: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 130: warning: exported method TextAP.ReadSignature should have comment or be unexported (golint)
    • Line 130: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 147: warning: exported method TextAP.ReadCertificate should have comment or be unexported (golint)
    • Line 147: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 164: warning: exported method TextAP.ReadBasicInfo should have comment or be unexported (golint)
    • Line 164: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 188: warning: comment on exported method TextAttrs.HeaderString should be of the form "HeaderString ..." (golint)
    • Line 189: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 193: warning: comment on exported method TextAttrs.SexString should be of the form "SexString ..." (golint)
    • Line 194: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • myna/libmyna/validate.go
    • Line 8: warning: exported function Validate4DigitPin should have comment or be unexported (golint)
    • Line 16: warning: exported function ValidateJPKISignPassword should have comment or be unexported (golint)
    • myna/libmyna/apdu.go
    • Line 7: warning: exported type APDU should have comment or be unexported (golint)
    • Line 11: warning: exported function NewAPDU should have comment or be unexported (golint)
    • Line 20: warning: exported function NewAPDUCase1 should have comment or be unexported (golint)
    • Line 25: warning: exported function NewAPDUCase2 should have comment or be unexported (golint)
    • Line 30: warning: exported function NewAPDUCase3 should have comment or be unexported (golint)
    • Line 36: warning: exported function NewAPDUCase4 should have comment or be unexported (golint)
    • Line 43: warning: exported method APDU.ToString should have comment or be unexported (golint)
    • Line 43: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • myna/libmyna/common.go
    • Line 62: warning: exported type ContentInfo should have comment or be unexported (golint)
    • Line 75: warning: exported function Name2String should have comment or be unexported (golint)
    • myna/libmyna/errors.go
    • Line 7: warning: exported type APDUError should have comment or be unexported (golint)
    • Line 12: warning: exported function NewAPDUError should have comment or be unexported (golint)
    • Line 16: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • myna/libmyna/jpki_ap.go
    • Line 14: warning: exported type JPKIAP should have comment or be unexported (golint)
    • Line 18: warning: exported method JPKIAP.GetToken should have comment or be unexported (golint)
    • Line 18: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 29: warning: exported method JPKIAP.LookupAuthPin should have comment or be unexported (golint)
    • Line 29: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 38: warning: exported method JPKIAP.VerifyAuthPin should have comment or be unexported (golint)
    • Line 38: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 50: warning: exported method JPKIAP.LookupSignPin should have comment or be unexported (golint)
    • Line 50: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 59: warning: exported method JPKIAP.VerifySignPin should have comment or be unexported (golint)
    • Line 59: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 71: warning: exported method JPKIAP.ReadCertificate should have comment or be unexported (golint)
    • Line 71: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 91: warning: exported type JPKICertificate should have comment or be unexported (golint)
    • Line 103: warning: exported method JPKICertificate.GetSubjectAltNames should have comment or be unexported (golint)
    • Line 103: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 112: warning: exported type JPKICertificateAttr should have comment or be unexported (golint)
    • Line 117: warning: exported type JPKICertificateAttrValues should have comment or be unexported (golint)
    • Line 121: warning: exported type JPKICertificateAttrs should have comment or be unexported (golint)
    • Line 130: warning: exported method JPKICertificate.GetAttributes should have comment or be unexported (golint)
    • Line 130: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 169: warning: exported method JPKICertificate.ToString should have comment or be unexported (golint)
    • Line 169: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • myna/libmyna/visual_ap.go
    • Line 9: warning: exported type VisualAP should have comment or be unexported (golint)
    • Line 13: warning: exported type VisualInfo should have comment or be unexported (golint)
    • Line 26: warning: exported method VisualAP.LookupPinA should have comment or be unexported (golint)
    • Line 26: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 35: warning: exported method VisualAP.VerifyPinA should have comment or be unexported (golint)
    • Line 35: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 44: warning: exported method VisualAP.LookupPinB should have comment or be unexported (golint)
    • Line 44: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 53: warning: exported method VisualAP.VerifyPinB should have comment or be unexported (golint)
    • Line 53: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 62: warning: exported method VisualAP.GetVisualInfo should have comment or be unexported (golint)
    • Line 62: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • myna/libmyna/api.go
    • Line 20: warning: exported function CheckCard should have comment or be unexported (golint)
    • Line 51: warning: comment on exported function GetMyNumber should be of the form "GetMyNumber ..." (golint)
    • Line 78: warning: comment on exported function GetAttrInfo should be of the form "GetAttrInfo ..." (golint)
    • Line 102: warning: exported type CardInfo should have comment or be unexported (golint)
    • Line 105: warning: comment on exported function GetVisualInfo should be of the form "GetVisualInfo ..." (golint)
    • Line 134: warning: exported function ChangeCardInputHelperPin should have comment or be unexported (golint)
    • Line 138: warning: exported function ChangeJPKIAuthPin should have comment or be unexported (golint)
    • Line 142: warning: exported function Change4DigitPin should have comment or be unexported (golint)
    • Line 185: warning: exported function ChangeJPKISignPin should have comment or be unexported (golint)
    • Line 223: warning: exported function GetJPKICert should have comment or be unexported (golint)
    • Line 249: warning: exported function GetJPKIAuthCert should have comment or be unexported (golint)
    • Line 253: warning: exported function GetJPKIAuthCACert should have comment or be unexported (golint)
    • Line 257: warning: exported function GetJPKISignCert should have comment or be unexported (golint)
    • Line 261: warning: exported function GetJPKISignCACert should have comment or be unexported (golint)
    • Line 341: warning: exported type JPKISignSigner should have comment or be unexported (golint)
    • Line 346: warning: exported method JPKISignSigner.Public should have comment or be unexported (golint)
    • Line 346: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 350: warning: exported method JPKISignSigner.Sign should have comment or be unexported (golint)
    • Line 350: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 376: warning: exported function GetDigestOID should have comment or be unexported (golint)
    • Line 391: warning: exported type CmsSignOpts should have comment or be unexported (golint)
    • Line 397: warning: exported type CmsVerifyOpts should have comment or be unexported (golint)
    • Line 403: warning: exported function CmsSignJPKISign should have comment or be unexported (golint)
    • Line 498: warning: exported function CmsVerifyJPKISign should have comment or be unexported (golint)
    • Line 526: warning: exported function GetPinStatus should have comment or be unexported (golint)
    • myna/libmyna/reader.go
    • Line 13: warning: exported type Reader should have comment or be unexported (golint)
    • Line 20: warning: exported function Debug should have comment or be unexported (golint)
    • Line 26: warning: exported var OptionDebug should have comment or be unexported (golint)
    • Line 28: warning: exported function NewReader should have comment or be unexported (golint)
    • Line 58: warning: exported method Reader.SetDebug should have comment or be unexported (golint)
    • Line 58: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 62: warning: exported method Reader.Finalize should have comment or be unexported (golint)
    • Line 62: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 66: warning: exported method Reader.GetCard should have comment or be unexported (golint)
    • Line 66: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 73: warning: exported method Reader.Connect should have comment or be unexported (golint)
    • Line 73: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 90: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 103: warning: exported method Reader.SelectVisualAP should have comment or be unexported (golint)
    • Line 103: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 109: warning: exported method Reader.SelectTextAP should have comment or be unexported (golint)
    • Line 109: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 115: warning: exported method Reader.SelectJPKIAP should have comment or be unexported (golint)
    • Line 115: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 121: warning: exported method Reader.SelectDF should have comment or be unexported (golint)
    • Line 121: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 130: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 135: warning: exported method Reader.SelectEF should have comment or be unexported (golint)
    • Line 135: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 144: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 149: warning: exported method Reader.LookupPin should have comment or be unexported (golint)
    • Line 149: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 157: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 162: warning: exported method Reader.Verify should have comment or be unexported (golint)
    • Line 162: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 188: warning: exported method Reader.ChangePin should have comment or be unexported (golint)
    • Line 188: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 197: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 215: warning: exported method Reader.Trans should have comment or be unexported (golint)
    • Line 215: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 246: warning: exported method Reader.ReadBinary should have comment or be unexported (golint)
    • Line 246: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 273: warning: exported method Reader.Signature should have comment or be unexported (golint)
    • Line 273: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 282: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • myna/libmyna/utils.go
    • Line 9: warning: exported function ToBytes should have comment or be unexported (golint)
    • Line 14: warning: exported function ToHexString should have comment or be unexported (golint)
    • Line 19: warning: exported type ASN1PartialParser should have comment or be unexported (golint)
    • Line 24: warning: exported method ASN1PartialParser.GetOffset should have comment or be unexported (golint)
    • Line 24: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 28: warning: exported method ASN1PartialParser.GetSize should have comment or be unexported (golint)
    • Line 28: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 32: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 47: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 70: warning: exported method ASN1PartialParser.Parse should have comment or be unexported (golint)
    • Line 70: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign78%

IneffAssign detects ineffectual assignments in Go code.

    • myna/libmyna/api.go
    • Line 41: warning: ineffectual assignment to err (ineffassign)
    • Line 245: warning: ineffectual assignment to err (ineffassign)
    • Line 422: warning: ineffectual assignment to err (ineffassign)
    • Line 543: warning: ineffectual assignment to err (ineffassign)
    • Line 544: warning: ineffectual assignment to err (ineffassign)
    • Line 550: warning: ineffectual assignment to err (ineffassign)
    • Line 551: warning: ineffectual assignment to err (ineffassign)
    • Line 552: warning: ineffectual assignment to err (ineffassign)
    • Line 558: warning: ineffectual assignment to err (ineffassign)
    • Line 559: warning: ineffectual assignment to err (ineffassign)
    • myna/cmd/pin.go
    • Line 67: warning: ineffectual assignment to err (ineffassign)
    • Line 75: warning: ineffectual assignment to err (ineffassign)
    • Line 103: warning: ineffectual assignment to err (ineffassign)
    • Line 146: warning: ineffectual assignment to err (ineffassign)
    • Line 153: warning: ineffectual assignment to err (ineffassign)
    • myna/cmd/text.go
    • Line 52: warning: ineffectual assignment to err (ineffassign)
    • Line 74: warning: ineffectual assignment to err (ineffassign)
    • Line 119: warning: ineffectual assignment to err (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!