Preparing report...

Report for github.com/finecloud/apisix-oauth2-plugin

A    Great!    Found 16 issues across 28 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!


gocyclo96%

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.


golint50%

Golint is a linter for Go source code.

    • apisix-oauth2-plugin/internal/http/request.go
    • Line 22: warning: exported type Request should have comment or be unexported (golint)
    • Line 40: warning: exported method Request.ConfToken should have comment or be unexported (golint)
    • Line 44: warning: exported method Request.ID should have comment or be unexported (golint)
    • Line 48: warning: exported method Request.SrcIP should have comment or be unexported (golint)
    • Line 52: warning: exported method Request.Method should have comment or be unexported (golint)
    • Line 56: warning: exported method Request.Path should have comment or be unexported (golint)
    • Line 63: warning: exported method Request.SetPath should have comment or be unexported (golint)
    • Line 67: warning: exported method Request.Header should have comment or be unexported (golint)
    • Line 99: warning: exported method Request.Args should have comment or be unexported (golint)
    • Line 115: warning: exported method Request.Var should have comment or be unexported (golint)
    • Line 143: warning: exported method Request.Reset should have comment or be unexported (golint)
    • Line 155: warning: exported method Request.FetchChanges should have comment or be unexported (golint)
    • Line 261: warning: exported method Request.BindConn should have comment or be unexported (golint)
    • Line 325: warning: exported function CreateRequest should have comment or be unexported (golint)
    • Line 331: warning: exported function ReuseRequest should have comment or be unexported (golint)
    • Line 336: warning: exported type Header should have comment or be unexported (golint)
    • Line 346: warning: exported method Header.View should have comment or be unexported (golint)
    • apisix-oauth2-plugin/internal/http/response.go
    • Line 13: warning: exported type Response should have comment or be unexported (golint)
    • Line 19: warning: exported method Response.Header should have comment or be unexported (golint)
    • Line 34: warning: exported method Response.WriteHeader should have comment or be unexported (golint)
    • Line 43: warning: exported method Response.Reset should have comment or be unexported (golint)
    • Line 49: warning: exported method Response.HasChange should have comment or be unexported (golint)
    • Line 53: warning: exported method Response.FetchChanges should have comment or be unexported (golint)
    • Line 120: warning: exported function CreateResponse should have comment or be unexported (golint)
    • Line 124: warning: exported function ReuseResponse should have comment or be unexported (golint)
    • apisix-oauth2-plugin/internal/plugin/plugin.go
    • Line 19: warning: exported type ParseConfFunc should have comment or be unexported (golint)
    • Line 20: warning: exported type FilterFunc should have comment or be unexported (golint)
    • Line 32: warning: exported type ErrPluginRegistered should have comment or be unexported (golint)
    • Line 43: warning: exported var ErrMissingName should have comment or be unexported (golint)
    • Line 48: warning: exported function RegisterPlugin should have comment or be unexported (golint)
    • Line 119: warning: exported function HTTPReqCall should have comment or be unexported (golint)
    • apisix-oauth2-plugin/cmd/go-runner/plugins/fault_injection.go
    • Line 15: warning: don't use underscores in Go names; const plugin_name should be pluginName (golint)
    • Line 29: warning: exported type FaultInjectionConf should have comment or be unexported (golint)
    • Line 35: warning: exported method FaultInjection.Name should have comment or be unexported (golint)
    • Line 39: warning: exported method FaultInjection.ParseConf should have comment or be unexported (golint)
    • Line 63: warning: exported method FaultInjection.Filter should have comment or be unexported (golint)
    • apisix-oauth2-plugin/cmd/go-runner/plugins/say.go
    • Line 24: warning: exported type SayConf should have comment or be unexported (golint)
    • Line 28: warning: exported method Say.Name should have comment or be unexported (golint)
    • Line 32: warning: exported method Say.ParseConf should have comment or be unexported (golint)
    • Line 38: warning: exported method Say.Filter should have comment or be unexported (golint)
    • apisix-oauth2-plugin/cmd/go-runner/main.go
    • Line 21: warning: exported var InfoOut should have comment or be unexported (golint)
    • Line 42: warning: exported type RunMode should have comment or be unexported (golint)
    • Line 45: warning: exported const Dev should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported var RunModeIds should have comment or be unexported (golint)
    • Line 129: warning: exported function NewCommand should have comment or be unexported (golint)
    • apisix-oauth2-plugin/internal/util/msg.go
    • Line 13: warning: exported const HeaderLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported const RPCError should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type RPCResult should have comment or be unexported (golint)
    • Line 29: warning: comment on exported type ExtraInfoResult should be of the form "ExtraInfoResult ..." (with optional leading article) (golint)
    • Line 32: warning: exported function ReadErr should have comment or be unexported (golint)
    • Line 45: warning: exported function WriteErr should have comment or be unexported (golint)
    • apisix-oauth2-plugin/pkg/log/log.go
    • Line 17: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 39: warning: exported function Infof should have comment or be unexported (golint)
    • Line 43: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 47: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 51: warning: exported function Fatalf should have comment or be unexported (golint)
    • apisix-oauth2-plugin/internal/plugin/conf.go
    • Line 21: warning: exported type ConfEntry should have comment or be unexported (golint)
    • Line 25: warning: exported type RuleConf should have comment or be unexported (golint)
    • Line 27: warning: exported type ConfCache should have comment or be unexported (golint)
    • Line 52: warning: exported method ConfCache.Set should have comment or be unexported (golint)
    • Line 110: warning: exported method ConfCache.SetInTest should have comment or be unexported (golint)
    • Line 114: warning: exported method ConfCache.Get should have comment or be unexported (golint)
    • Line 122: warning: exported function InitConfCache should have comment or be unexported (golint)
    • Line 126: warning: exported function PrepareConf should have comment or be unexported (golint)
    • Line 142: warning: exported function GetRuleConf should have comment or be unexported (golint)
    • Line 146: warning: exported function SetRuleConfInTest should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!