Preparing report...

Report for github.com/pritunl/webauthn

(v1.0.1)

A+    Excellent!    Found 29 issues across 50 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!


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.

    • webauthn/login.go
    • Line 103: warning: cyclomatic complexity 18 of function (*WebAuthn).ValidateLogin() is high (> 15) (gocyclo)

golint52%

Golint is a linter for Go source code.

    • protocol/attestation.go
    • Line 18: warning: comment on exported type AuthenticatorAttestationResponse should be of the form "AuthenticatorAttestationResponse ..." (with optional leading article) (golint)
    • Line 40: warning: comment on exported type ParsedAttestationResponse should be of the form "ParsedAttestationResponse ..." (with optional leading article) (golint)
    • Line 46: warning: comment on exported type AttestationObject should be of the form "AttestationObject ..." (with optional leading article) (golint)
    • Line 71: warning: comment on exported function RegisterAttestationFormat should be of the form "RegisterAttestationFormat ..." (golint)
    • protocol/client.go
    • Line 27: warning: exported type CeremonyType should have comment or be unexported (golint)
    • Line 30: warning: exported const CreateCeremony should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported type TokenBinding should have comment or be unexported (golint)
    • Line 39: warning: exported type TokenBindingStatus should have comment or be unexported (golint)
    • Line 42: warning: comment on exported const Present should be of the form "Present ..." (golint)
    • Line 45: warning: comment on exported const Supported should be of the form "Supported ..." (golint)
    • Line 48: warning: comment on exported const NotSupported should be of the form "NotSupported ..." (golint)
    • Line 53: warning: comment on exported function FullyQualifiedOrigin should be of the form "FullyQualifiedOrigin ..." (golint)
    • Line 58: warning: comment on exported method CollectedClientData.Verify should be of the form "Verify ..." (golint)
    • protocol/errors.go
    • Line 3: warning: exported type Error should have comment or be unexported (golint)
    • Line 13: warning: exported var ErrBadRequest should have comment or be unexported (golint)
    • Line 75: warning: exported method Error.WithDetails should have comment or be unexported (golint)
    • Line 81: warning: exported method Error.WithInfo should have comment or be unexported (golint)
    • protocol/entities.go
    • Line 3: warning: comment on exported type CredentialEntity should be of the form "CredentialEntity ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported type RelyingPartyEntity should be of the form "RelyingPartyEntity ..." (with optional leading article) (golint)
    • Line 34: warning: comment on exported type UserEntity should be of the form "UserEntity ..." (with optional leading article) (golint)
    • webauthn/login.go
    • Line 18: warning: comment on exported method WebAuthn.BeginLogin should be of the form "BeginLogin ..." (golint)
    • Line 70: warning: comment on exported function WithAllowedCredentials should be of the form "WithAllowedCredentials ..." (golint)
    • Line 78: warning: comment on exported function WithUserVerification should be of the form "WithUserVerification ..." (golint)
    • Line 85: warning: comment on exported function WithAssertionExtensions should be of the form "WithAssertionExtensions ..." (golint)
    • Line 92: warning: comment on exported method WebAuthn.FinishLogin should be of the form "FinishLogin ..." (golint)
    • webauthn/main.go
    • Line 17: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 72: warning: comment on exported function New should be of the form "New ..." (golint)
    • protocol/assertion.go
    • Line 14: warning: comment on exported type CredentialAssertionResponse should be of the form "CredentialAssertionResponse ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported type ParsedCredentialAssertionData should be of the form "ParsedCredentialAssertionData ..." (with optional leading article) (golint)
    • Line 38: warning: comment on exported type ParsedAssertionResponse should be of the form "ParsedAssertionResponse ..." (with optional leading article) (golint)
    • Line 46: warning: comment on exported function ParseCredentialRequestResponse should be of the form "ParseCredentialRequestResponse ..." (golint)
    • Line 57: warning: comment on exported function ParseCredentialRequestResponseBody should be of the form "ParseCredentialRequestResponseBody ..." (golint)
    • Line 100: warning: comment on exported method ParsedCredentialAssertionData.Verify should be of the form "Verify ..." (golint)
    • protocol/attestation_apple.go
    • Line 101: warning: comment on exported type AppleAnonymousAttestation should be of the form "AppleAnonymousAttestation ..." (with optional leading article) (golint)
    • protocol/options.go
    • Line 7: warning: exported type CredentialCreation should have comment or be unexported (golint)
    • Line 11: warning: exported type CredentialAssertion should have comment or be unexported (golint)
    • Line 15: warning: comment on exported type PublicKeyCredentialCreationOptions should be of the form "PublicKeyCredentialCreationOptions ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported type CredentialDescriptor should be of the form "CredentialDescriptor ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported type CredentialType should be of the form "CredentialType ..." (with optional leading article) (golint)
    • Line 80: warning: comment on exported type AuthenticatorSelection should be of the form "AuthenticatorSelection ..." (with optional leading article) (golint)
    • Line 97: warning: comment on exported type ConveyancePreference should be of the form "ConveyancePreference ..." (with optional leading article) (golint)
    • Line 102: warning: comment on exported const PreferNoAttestation should be of the form "PreferNoAttestation ..." (golint)
    • Line 106: warning: comment on exported const PreferIndirectAttestation should be of the form "PreferIndirectAttestation ..." (golint)
    • Line 112: warning: comment on exported const PreferDirectAttestation should be of the form "PreferDirectAttestation ..." (golint)
    • Line 116: warning: exported method PublicKeyCredentialRequestOptions.GetAllowedCredentialIDs should have comment or be unexported (golint)
    • Line 124: warning: exported type Extensions should have comment or be unexported (golint)
    • Line 126: warning: exported type ServerResponse should have comment or be unexported (golint)
    • Line 131: warning: exported type ServerResponseStatus should have comment or be unexported (golint)
    • Line 134: warning: exported const StatusOk should have comment (or a comment on this block) or be unexported (golint)
    • protocol/webauthncose/webauthncose.go
    • Line 35: warning: exported type EC2PublicKeyData should have comment or be unexported (golint)
    • Line 45: warning: exported type RSAPublicKeyData should have comment or be unexported (golint)
    • Line 53: warning: exported type OKPPublicKeyData should have comment or be unexported (golint)
    • Line 139: warning: comment on exported function SigAlgFromCOSEAlg should be of the form "SigAlgFromCOSEAlg ..." (golint)
    • Line 149: warning: comment on exported function HasherFromCOSEAlg should be of the form "HasherFromCOSEAlg ..." (golint)
    • Line 160: warning: comment on exported function ParsePublicKey should be of the form "ParsePublicKey ..." (golint)
    • Line 185: warning: exported function ParseFIDOPublicKey should have comment or be unexported (golint)
    • Line 229: warning: comment on exported type COSEKeyType should be of the form "COSEKeyType ..." (with optional leading article) (golint)
    • Line 241: warning: exported function VerifySignature should have comment or be unexported (golint)
    • Line 258: warning: exported function DisplayPublicKey should have comment or be unexported (golint)
    • Line 328: warning: comment on exported type SignatureAlgorithm should be of the form "SignatureAlgorithm ..." (with optional leading article) (golint)
    • Line 332: warning: exported const UnknownSignatureAlgorithm should have comment (or a comment on this block) or be unexported (golint)
    • Line 350: warning: exported var SignatureAlgorithmDetails should have comment or be unexported (golint)
    • Line 369: warning: exported type Error should have comment or be unexported (golint)
    • Line 379: warning: exported var ErrUnsupportedKey should have comment or be unexported (golint)
    • Line 397: warning: exported method Error.WithDetails should have comment or be unexported (golint)
    • Line 397: warning: receiver name passedError should be consistent with previous receiver name err for Error (golint)
    • webauthn/authenticator.go
    • Line 7: warning: exported type Authenticator should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function SelectAuthenticator should be of the form "SelectAuthenticator ..." (golint)
    • Line 32: warning: comment on exported method Authenticator.UpdateCounter should be of the form "UpdateCounter ..." (golint)
    • protocol/attestation_androidkey.go
    • Line 191: warning: exported const Verified should have comment (or a comment on this block) or be unexported (golint)
    • Line 197: warning: comment on exported type KM_KEY_ORIGIN should be of the form "KM_KEY_ORIGIN ..." (with optional leading article) (golint)
    • Line 206: warning: exported const KM_ORIGIN_GENERATED should have comment (or a comment on this block) or be unexported (golint)
    • Line 215: warning: comment on exported type KM_PURPOSE should be of the form "KM_PURPOSE ..." (with optional leading article) (golint)
    • Line 221: warning: exported const KM_PURPOSE_ENCRYPT should have comment (or a comment on this block) or be unexported (golint)
    • protocol/authenticator.go
    • Line 16: warning: comment on exported type AuthenticatorResponse should be of the form "AuthenticatorResponse ..." (with optional leading article) (golint)
    • Line 46: warning: exported type AttestedCredentialData should have comment or be unexported (golint)
    • Line 68: warning: comment on exported type AuthenticatorTransport should be of the form "AuthenticatorTransport ..." (with optional leading article) (golint)
    • Line 88: warning: comment on exported type UserVerificationRequirement should be of the form "UserVerificationRequirement ..." (with optional leading article) (golint)
    • protocol/credential.go
    • Line 11: warning: comment on exported type Credential should be of the form "Credential ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported type ParsedCredential should be of the form "ParsedCredential ..." (with optional leading article) (golint)
    • Line 33: warning: exported type PublicKeyCredential should have comment or be unexported (golint)
    • Line 39: warning: exported type ParsedPublicKeyCredential should have comment or be unexported (golint)
    • Line 45: warning: exported type CredentialCreationResponse should have comment or be unexported (golint)
    • Line 51: warning: exported type ParsedCredentialCreationData should have comment or be unexported (golint)
    • Line 58: warning: exported function ParseCredentialCreationResponse should have comment or be unexported (golint)
    • Line 65: warning: exported function ParseCredentialCreationResponseBody should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method ParsedCredentialCreationData.Verify should be of the form "Verify ..." (golint)
    • webauthn/registration.go
    • Line 16: warning: exported type RegistrationOption should have comment or be unexported (golint)
    • Line 18: warning: comment on exported method WebAuthn.BeginRegistration should be of the form "BeginRegistration ..." (golint)
    • Line 72: warning: comment on exported function WithAuthenticatorSelection should be of the form "WithAuthenticatorSelection ..." (golint)
    • Line 79: warning: comment on exported function WithExclusions should be of the form "WithExclusions ..." (golint)
    • Line 86: warning: comment on exported function WithConveyancePreference should be of the form "WithConveyancePreference ..." (golint)
    • Line 93: warning: comment on exported function WithExtensions should be of the form "WithExtensions ..." (golint)
    • Line 100: warning: comment on exported method WebAuthn.FinishRegistration should be of the form "FinishRegistration ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign90%

IneffAssign detects ineffectual assignments in Go code.

    • protocol/attestation_tpm.go
    • Line 80: warning: ineffectual assignment to err (ineffassign)
    • Line 105: warning: ineffectual assignment to err (ineffassign)
    • Line 171: warning: ineffectual assignment to err (ineffassign)
    • Line 80: warning: ineffectual assignment to err (ineffassign)
    • Line 105: warning: ineffectual assignment to err (ineffassign)
    • Line 171: warning: ineffectual assignment to err (ineffassign)

misspell94%

Misspell Finds commonly misspelled English words

    • metadata/metadata.go
    • Line 29: warning: "shouldt" is a misspelling of "shouldnt" (misspell)
    • Line 340: warning: "ommitted" is a misspelling of "omitted" (misspell)
    • Line 343: warning: "ommitted" is a misspelling of "omitted" (misspell)