Preparing report...

Report for github.com/square/go-jose

(v2.6.0+incompatible)

A+    Excellent!    Found 20 issues across 60 files

Tweet

gofmt98%

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!


golint85%

Golint is a linter for Go source code.

    • shared.go
    • Line 131: warning: comment on exported type HeaderKey should be of the form "HeaderKey ..." (with optional leading article) (golint)
    • Line 136: warning: exported const HeaderType should have comment (or a comment on this block) or be unexported (golint)
    • Line 455: warning: receiver name dst should be consistent with previous receiver name parsed for rawHeader (golint)
    • Line 475: warning: receiver name dst should be consistent with previous receiver name parsed for rawHeader (golint)
    • symmetric.go
    • Line 37: warning: comment on exported var RandReader should be of the form "RandReader ..." (golint)
    • json/stream.go
    • Line 34: warning: comment on exported method Decoder.UseNumber should be of the form "UseNumber ..." (golint)
    • json/encode.go
    • Line 211: warning: exported type UnsupportedValueError should have comment or be unexported (golint)
    • Line 220: warning: comment on exported type InvalidUTF8Error should be of the form "InvalidUTF8Error ..." (with optional leading article) (golint)
    • Line 234: warning: exported type MarshalerError should have comment or be unexported (golint)
    • jwt/builder_test.go
    • Line 78: warning: should replace t.Error(fmt.Sprintf(...)) with t.Errorf(...) (golint)
    • Line 81: warning: should replace t.Error(fmt.Sprintf(...)) with t.Errorf(...) (golint)
    • jwt/claims.go
    • Line 114: warning: exported method Audience.Contains should have comment or be unexported (golint)
    • jwt/jwt.go
    • Line 35: warning: exported type NestedJSONWebToken should have comment or be unexported (golint)
    • Line 74: warning: exported method NestedJSONWebToken.Decrypt should have comment or be unexported (golint)
    • json/decode.go
    • Line 249: warning: exported type NumberUnmarshalType should have comment or be unexported (golint)
    • Line 252: warning: comment on exported const UnmarshalFloat should be of the form "UnmarshalFloat ..." (golint)
    • Line 254: warning: comment on exported const UnmarshalJSONNumber should be of the form "UnmarshalJSONNumber ..." (golint)
    • Line 256: warning: comment on exported const UnmarshalIntOrFloat should be of the form "UnmarshalIntOrFloat ..." (golint)

gocyclo76%

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.

    • crypter.go
    • Line 315: warning: cyclomatic complexity 16 of function (*genericEncrypter).EncryptWithAuthData() is high (> 15) (gocyclo)
    • jwk.go
    • Line 165: warning: cyclomatic complexity 36 of function (*JSONWebKey).UnmarshalJSON() is high (> 15) (gocyclo)
    • Line 429: warning: cyclomatic complexity 23 of function (*JSONWebKey).Valid() is high (> 15) (gocyclo)
    • Line 93: warning: cyclomatic complexity 19 of function (JSONWebKey).MarshalJSON() is high (> 15) (gocyclo)
    • jws.go
    • Line 152: warning: cyclomatic complexity 30 of function (*rawJSONWebSignature).sanitized() is high (> 15) (gocyclo)
    • json/stream.go
    • Line 323: warning: cyclomatic complexity 24 of function (*Decoder).Token() is high (> 15) (gocyclo)
    • jwt/validation.go
    • Line 76: warning: cyclomatic complexity 17 of function (Claims).ValidateWithLeeway() is high (> 15) (gocyclo)
    • json/decode.go
    • Line 780: warning: cyclomatic complexity 46 of function (*decodeState).literalStore() is high (> 15) (gocyclo)
    • Line 568: warning: cyclomatic complexity 31 of function (*decodeState).object() is high (> 15) (gocyclo)
    • Line 1105: warning: cyclomatic complexity 28 of function unquoteBytes() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 26 of function isValidNumber() is high (> 15) (gocyclo)
    • Line 460: warning: cyclomatic complexity 22 of function (*decodeState).array() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 19 of function (*decodeState).indirect() is high (> 15) (gocyclo)
    • jwe.go
    • Line 128: warning: cyclomatic complexity 17 of function (*rawJSONWebEncryption).sanitized() is high (> 15) (gocyclo)
    • json/encode.go
    • Line 1000: warning: cyclomatic complexity 24 of function typeFields() is high (> 15) (gocyclo)
    • Line 788: warning: cyclomatic complexity 21 of function (*encodeState).string() is high (> 15) (gocyclo)
    • Line 359: warning: cyclomatic complexity 21 of function newTypeEncoder() is high (> 15) (gocyclo)
    • Line 864: warning: cyclomatic complexity 21 of function (*encodeState).stringBytes() is high (> 15) (gocyclo)
    • json/indent.go
    • Line 15: warning: cyclomatic complexity 17 of function compact() is high (> 15) (gocyclo)
    • shared.go
    • Line 374: warning: cyclomatic complexity 16 of function (rawHeader).sanitized() is high (> 15) (gocyclo)
    • json/decode_test.go
    • Line 613: warning: cyclomatic complexity 17 of function TestNumberAccessors() is high (> 15) (gocyclo)
    • Line 1155: warning: cyclomatic complexity 16 of function TestUnmarshalNulls() is high (> 15) (gocyclo)
    • symmetric.go
    • Line 348: warning: cyclomatic complexity 17 of function (*symmetricKeyCipher).decryptKey() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words