Preparing report...

Report for github.com/nats-io/jwt

A+    Excellent!    Found 26 issues across 61 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!


golint72%

Golint is a linter for Go source code.

    • jwt/server_claims.go
    • Line 24: warning: comment on exported type Server should be of the form "Server ..." (with optional leading article) (golint)
    • Line 37: warning: comment on exported type ServerClaims should be of the form "ServerClaims ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported function NewServerClaims should be of the form "NewServerClaims ..." (golint)
    • Line 62: warning: comment on exported function DecodeServerClaims should be of the form "DecodeServerClaims ..." (golint)
    • jwt/v2/account_claims.go
    • Line 29: warning: exported type AccountLimits should have comment or be unexported (golint)
    • Line 42: warning: exported type NatsLimits should have comment or be unexported (golint)
    • Line 53: warning: exported type JetStreamLimits should have comment or be unexported (golint)
    • Line 87: warning: comment on exported type WeightedMapping should be of the form "WeightedMapping ..." (with optional leading article) (golint)
    • Line 94: warning: exported method WeightedMapping.GetWeight should have comment or be unexported (golint)
    • Line 101: warning: exported type Mapping should have comment or be unexported (golint)
    • Line 103: warning: exported method Mapping.Validate should have comment or be unexported (golint)
    • Line 121: warning: exported method Account.AddMapping should have comment or be unexported (golint)
    • Line 242: warning: exported method AccountClaims.ClaimType should have comment or be unexported (golint)
    • jwt/v2/signingkeys.go
    • Line 26: warning: exported type Scope should have comment or be unexported (golint)
    • Line 32: warning: exported type ScopeType should have comment or be unexported (golint)
    • Line 35: warning: exported const UserScopeType should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported method ScopeType.MarshalJSON should have comment or be unexported (golint)
    • Line 54: warning: exported method ScopeType.UnmarshalJSON should have comment or be unexported (golint)
    • Line 68: warning: exported type UserScope should have comment or be unexported (golint)
    • Line 75: warning: exported function NewUserScope should have comment or be unexported (golint)
    • Line 82: warning: exported method UserScope.SigningKey should have comment or be unexported (golint)
    • Line 86: warning: exported method UserScope.Validate should have comment or be unexported (golint)
    • Line 92: warning: exported method UserScope.ValidateScopedSigner should have comment or be unexported (golint)
    • Line 109: warning: exported method SigningKeys.Validate should have comment or be unexported (golint)
    • Line 135: warning: exported method SigningKeys.UnmarshalJSON should have comment or be unexported (golint)
    • Line 165: warning: exported method SigningKeys.Keys should have comment or be unexported (golint)
    • Line 182: warning: exported method SigningKeys.Contains should have comment or be unexported (golint)
    • Line 187: warning: exported method SigningKeys.Add should have comment or be unexported (golint)
    • Line 193: warning: exported method SigningKeys.AddScopedSigner should have comment or be unexported (golint)
    • Line 197: warning: exported method SigningKeys.Remove should have comment or be unexported (golint)
    • jwt/v2/user_claims.go
    • Line 26: warning: exported const ConnectionTypeStandard should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type UserPermissionLimits should have comment or be unexported (golint)
    • Line 75: warning: exported method UserClaims.SetScoped should have comment or be unexported (golint)
    • Line 86: warning: exported method UserClaims.HasEmptyPermissions should have comment or be unexported (golint)
    • Line 112: warning: exported method UserClaims.ClaimType should have comment or be unexported (golint)
    • jwt/operator_claims.go
    • Line 161: warning: comment on exported method OperatorClaims.AddSigningKey should be of the form "AddSigningKey ..." (golint)
    • jwt/v2/header.go
    • Line 34: warning: comment on exported const AlgorithmNkeyOld should be of the form "AlgorithmNkeyOld ..." (golint)
    • Line 37: warning: exported const AlgorithmNkey should have comment (or a comment on this block) or be unexported (golint)
    • jwt/v2/operator_claims.go
    • Line 51: warning: exported function ParseServerVersion should have comment or be unexported (golint)
    • Line 201: warning: exported method OperatorClaims.ClaimType should have comment or be unexported (golint)
    • jwt/v2/types.go
    • Line 29: warning: exported const MaxInfoLength should have comment or be unexported (golint)
    • Line 31: warning: exported type Info should have comment or be unexported (golint)
    • Line 36: warning: exported method Info.Validate should have comment or be unexported (golint)
    • Line 105: warning: exported type RenamingSubject should have comment or be unexported (golint)
    • Line 107: warning: exported method RenamingSubject.Validate should have comment or be unexported (golint)
    • Line 146: warning: comment on exported method RenamingSubject.ToSubject should be of the form "ToSubject ..." (golint)
    • Line 269: warning: comment on exported type UserLimits should be of the form "UserLimits ..." (with optional leading article) (golint)
    • Line 276: warning: exported method UserLimits.Empty should have comment or be unexported (golint)
    • Line 280: warning: exported method UserLimits.IsUnlimited should have comment or be unexported (golint)
    • Line 290: warning: exported method Limits.IsUnlimited should have comment or be unexported (golint)
    • Line 324: warning: exported method Permission.Empty should have comment or be unexported (golint)
    • Line 456: warning: exported type CIDRList should have comment or be unexported (golint)
    • Line 458: warning: exported method CIDRList.Contains should have comment or be unexported (golint)
    • Line 462: warning: exported method CIDRList.Add should have comment or be unexported (golint)
    • Line 466: warning: exported method CIDRList.Remove should have comment or be unexported (golint)
    • Line 470: warning: exported method CIDRList.Set should have comment or be unexported (golint)
    • Line 475: warning: exported method CIDRList.UnmarshalJSON should have comment or be unexported (golint)
    • jwt/exports.go
    • Line 62: warning: exported method ServiceLatency.Validate should have comment or be unexported (golint)
    • jwt/v2/claims.go
    • Line 46: warning: exported function IsGenericClaimType should have comment or be unexported (golint)
    • Line 77: warning: exported type GenericFields should have comment or be unexported (golint)
    • jwt/v2/exports.go
    • Line 64: warning: exported type SamplingRate should have comment or be unexported (golint)
    • Line 66: warning: exported const Headers should have comment or be unexported (golint)
    • Line 81: warning: receiver name t should be consistent with previous receiver name r for SamplingRate (golint)
    • Line 98: warning: exported method ServiceLatency.Validate should have comment or be unexported (golint)
    • jwt/v2/imports.go
    • Line 55: warning: comment on exported method Import.GetTo should be of the form "GetTo ..." (golint)
    • jwt/v2/revocation_list.go
    • Line 22: warning: exported const All should have comment or be unexported (golint)
    • Line 26: warning: exported type RevocationEntry should have comment or be unexported (golint)

gocyclo81%

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.

    • jwt/exports_test.go
    • Line 43: warning: cyclomatic complexity 23 of function TestResponseTypeValidation() is high (> 15) (gocyclo)
    • jwt/claims.go
    • Line 98: warning: cyclomatic complexity 22 of function (*ClaimsData).doEncode() is high (> 15) (gocyclo)
    • Line 246: warning: cyclomatic complexity 19 of function Decode() is high (> 15) (gocyclo)
    • jwt/v2/claims.go
    • Line 116: warning: cyclomatic complexity 25 of function (*ClaimsData).doEncode() is high (> 15) (gocyclo)
    • jwt/v2/imports.go
    • Line 61: warning: cyclomatic complexity 20 of function (*Import).Validate() is high (> 15) (gocyclo)
    • jwt/imports.go
    • Line 55: warning: cyclomatic complexity 25 of function (*Import).Validate() 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!