Preparing report...

Report for github.com/jinmukeji/plat-pkg

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


gocyclo100%

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.

No problems detected. Good job!


golint32%

Golint is a linter for Go source code.

    • plat-pkg/experiments/whitelist/matcher/matcher.go
    • Line 10: warning: exported type Matcher should have comment or be unexported (golint)
    • Line 14: warning: exported function NewMatcher should have comment or be unexported (golint)
    • Line 20: warning: exported method Matcher.LoadPatterns should have comment or be unexported (golint)
    • Line 32: warning: exported method Matcher.Match should have comment or be unexported (golint)
    • Line 45: warning: exported function Match should have comment or be unexported (golint)
    • plat-pkg/rpc/service/server.go
    • Line 7: warning: exported type RegisterServerFunc should have comment or be unexported (golint)
    • Line 9: warning: exported function RegisterServer should have comment or be unexported (golint)
    • plat-pkg/dbutil/mysql/options.go
    • Line 10: warning: exported type Options should have comment or be unexported (golint)
    • Line 19: warning: exported function WithMySQLConfig should have comment or be unexported (golint)
    • Line 25: warning: exported function WithTLS should have comment or be unexported (golint)
    • Line 31: warning: exported function WithLogLevel should have comment or be unexported (golint)
    • plat-pkg/micro/errors/rpc_error.go
    • Line 11: warning: exported type RpcError should have comment or be unexported (golint)
    • Line 52: warning: comment on exported function ErrorWithCause should be of the form "ErrorWithCause ..." (golint)
    • Line 58: warning: comment on exported function ErrorfWithCause should be of the form "ErrorfWithCause ..." (golint)
    • Line 101: warning: exported method RpcError.DetailedError should have comment or be unexported (golint)
    • Line 113: warning: exported method RpcError.GetCode should have comment or be unexported (golint)
    • Line 121: warning: exported method RpcError.GetMessage should have comment or be unexported (golint)
    • Line 129: warning: exported method RpcError.GetCause should have comment or be unexported (golint)
    • plat-pkg/store/store.go
    • Line 20: warning: exported type Closer should have comment or be unexported (golint)
    • Line 24: warning: exported type Store should have comment or be unexported (golint)
    • plat-pkg/micro/meta/util.go
    • Line 15: warning: exported function Get should have comment or be unexported (golint)
    • Line 19: warning: exported function MustGet should have comment or be unexported (golint)
    • Line 27: warning: exported function Set should have comment or be unexported (golint)
    • Line 31: warning: exported function Delete should have comment or be unexported (golint)
    • plat-pkg/rpc/service/service.go
    • Line 23: warning: exported type ServiceOptions should have comment or be unexported (golint)
    • Line 42: warning: exported function NewServiceOptions should have comment or be unexported (golint)
    • Line 50: warning: exported function CreateService should have comment or be unexported (golint)
    • plat-pkg/auth/jwt/jwt.go
    • Line 13: warning: exported var ErrParseClaimsFailed should have comment or be unexported (golint)
    • Line 98: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 147: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • plat-pkg/jm-micro/plugins/jwt/jwt.go
    • Line 72: warning: exported const AppIdKey should have comment or be unexported (golint)
    • Line 133: warning: exported function NewPlugin should have comment or be unexported (golint)
    • Line 137: warning: exported function NewJWT should have comment or be unexported (golint)
    • plat-pkg/rpc/log.go
    • Line 11: warning: exported function ContextWithLogger should have comment or be unexported (golint)
    • Line 16: warning: exported function LoggerFromContext should have comment or be unexported (golint)
    • plat-pkg/store/mysql/store.go
    • Line 14: warning: exported type MySqlStore should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMySqlStore should have comment or be unexported (golint)
    • Line 24: warning: exported function NewStore should have comment or be unexported (golint)
    • Line 30: warning: exported method MySqlStore.Close should have comment or be unexported (golint)
    • Line 41: warning: exported method MySqlStore.GetDB should have comment or be unexported (golint)
    • Line 44: 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 49: warning: exported method MySqlStore.BeginTx should have comment or be unexported (golint)
    • Line 54: warning: exported method MySqlStore.CommitTx should have comment or be unexported (golint)
    • Line 59: warning: exported method MySqlStore.RollbackTx should have comment or be unexported (golint)
    • Line 64: warning: exported method MySqlStore.GetError should have comment or be unexported (golint)
    • plat-pkg/rpc/service/web.go
    • Line 15: warning: exported type WebOptions should have comment or be unexported (golint)
    • Line 22: warning: exported function NewWebOptions should have comment or be unexported (golint)
    • Line 30: warning: exported function CreateWeb should have comment or be unexported (golint)
    • plat-pkg/jm-micro/main.go
    • Line 9: warning: exported const Name should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported var Version should have comment or be unexported (golint)
    • plat-pkg/experiments/whitelist/policy.go
    • Line 10: warning: exported type WhitelistPolicy should have comment or be unexported (golint)
    • Line 15: warning: exported type PolicySet should have comment or be unexported (golint)
    • Line 20: warning: exported function NewPolicySet should have comment or be unexported (golint)
    • Line 32: warning: exported method PolicySet.GetWhitelistPolicy should have comment or be unexported (golint)
    • Line 36: warning: exported method PolicySet.GetAllPatterns should have comment or be unexported (golint)
    • Line 57: warning: exported function LoadPolicy should have comment or be unexported (golint)
    • plat-pkg/auth/jwt/keystore/micro-config/micro_config.go
    • Line 38: warning: exported type MicroConfigStore should have comment or be unexported (golint)
    • Line 45: warning: exported function NewMicroConfigStore should have comment or be unexported (golint)
    • Line 90: warning: exported method MicroConfigStore.Get should have comment or be unexported (golint)
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • plat-pkg/auth/jwt/keystore/file/file_store.go
    • Line 37: warning: exported type FileStore should have comment or be unexported (golint)
    • Line 43: warning: exported function NewFileStore should have comment or be unexported (golint)
    • Line 49: warning: exported method FileStore.Get should have comment or be unexported (golint)
    • Line 56: warning: exported method FileStore.Load should have comment or be unexported (golint)
    • plat-pkg/dbutil/mysql/db.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: exported type DB should have comment or be unexported (golint)
    • plat-pkg/rpc/api.go
    • Line 10: warning: exported type APIService should have comment or be unexported (golint)
    • Line 14: warning: exported method APIService.GetLogger should have comment or be unexported (golint)
    • Line 23: warning: exported method APIService.Name should have comment or be unexported (golint)
    • plat-pkg/experiments/whitelist/presets.go
    • Line 12: warning: exported type Presets should have comment or be unexported (golint)
    • Line 14: warning: exported method Presets.GetRulePatterns should have comment or be unexported (golint)
    • Line 18: warning: exported function LoadPreset should have comment or be unexported (golint)
    • plat-pkg/grpc.go
    • Line 4: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • plat-pkg/micro/handler/jwt/options.go
    • Line 9: warning: exported type Options should have comment or be unexported (golint)
    • Line 17: warning: exported const DefaultMaxExpInterval should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported function DefaultOptions should have comment or be unexported (golint)
    • plat-pkg/auth/jwt/claims.go
    • Line 7: warning: exported type Claims should have comment or be unexported (golint)
    • Line 23: warning: exported method StandardClaims.GetIssuer should have comment or be unexported (golint)
    • Line 31: warning: exported method StandardClaims.GetExpiresAt should have comment or be unexported (golint)
    • Line 39: warning: exported method StandardClaims.GetIssuedAt should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)