Preparing report...

Report for github.com/douyu/jupiter

A+    Excellent!    Found 137 issues across 304 files

Tweet

gofmt94%

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!


golint61%

Golint is a linter for Go source code.

    • jupiter/pkg/registry/nop.go
    • Line 24: warning: comment on exported type Local should be of the form "Local ..." (with optional leading article) (golint)
    • Line 52: warning: comment on exported method Local.Kind should be of the form "Kind ..." (golint)
    • jupiter/pkg/xlog/config.go
    • Line 46: warning: exported var ConfigPrefix should have comment or be unexported (golint)
    • Line 83: warning: exported function ConfigEntry should have comment or be unexported (golint)
    • jupiter/example/http/gin-swagger/main.go
    • Line 49: warning: exported type Engine should have comment or be unexported (golint)
    • Line 53: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 74: warning: exported type Response should have comment or be unexported (golint)
    • Line 79: warning: exported type User should have comment or be unexported (golint)
    • jupiter/pkg/application/option.go
    • Line 19: warning: exported type Option should have comment or be unexported (golint)
    • Line 21: warning: exported type Disable should have comment or be unexported (golint)
    • Line 24: warning: exported const DisableParserFlag should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported method Application.WithOptions should have comment or be unexported (golint)
    • Line 35: warning: exported function WithConfigParser should have comment or be unexported (golint)
    • Line 41: warning: exported function WithDisable should have comment or be unexported (golint)
    • jupiter/pkg/client/rocketmq/consumer.go
    • Line 28: warning: exported type PushConsumer should have comment or be unexported (golint)
    • Line 38: warning: exported method ConsumerConfig.Build should have comment or be unexported (golint)
    • Line 66: warning: exported method PushConsumer.Close should have comment or be unexported (golint)
    • Line 75: warning: exported method PushConsumer.WithInterceptor should have comment or be unexported (golint)
    • Line 80: warning: exported method PushConsumer.Subscribe should have comment or be unexported (golint)
    • Line 99: warning: exported method PushConsumer.Start should have comment or be unexported (golint)
    • jupiter/pkg/sentinel/config.go
    • Line 30: warning: exported const ModuleName should have comment or be unexported (golint)
    • Line 63: warning: comment on exported method Config.Build should be of the form "Build ..." (golint)
    • Line 92: warning: exported function Entry should have comment or be unexported (golint)
    • jupiter/pkg/client/etcdv3/config.go
    • Line 28: warning: exported var ConfigPrefix should have comment or be unexported (golint)
    • Line 50: warning: exported method Config.BindFlags should have comment or be unexported (golint)
    • Line 89: warning: exported method Config.MustBuild should have comment or be unexported (golint)
    • jupiter/pkg/conf/api.go
    • Line 33: warning: exported function OnLoaded should have comment or be unexported (golint)
    • Line 44: warning: comment on exported function LoadFromReader should be of the form "LoadFromReader ..." (golint)
    • jupiter/example/job/main.go
    • Line 17: warning: exported type Engine should have comment or be unexported (golint)
    • Line 21: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 35: warning: exported type JobRunner should have comment or be unexported (golint)
    • Line 39: warning: exported function NewJobRunner should have comment or be unexported (golint)
    • Line 45: warning: exported method JobRunner.Run should have comment or be unexported (golint)
    • Line 49: warning: exported method JobRunner.GetJobName should have comment or be unexported (golint)
    • jupiter/pkg/client/rocketmq/init.go
    • Line 56: warning: exported function GetProducer should have comment or be unexported (golint)
    • Line 63: warning: comment on exported function GetConsumer should be of the form "GetConsumer ..." (golint)
    • Line 72: warning: comment on exported function InvokerProducer should be of the form "InvokerProducer ..." (golint)
    • jupiter/pkg/application/runtime.go
    • Line 24: warning: comment on exported type RuntimeStats should be of the form "RuntimeStats ..." (with optional leading article) (golint)
    • Line 32: warning: exported function NewRuntimeStats should have comment or be unexported (golint)
    • jupiter/pkg/worker/xcron/config.go
    • Line 168: warning: comment on exported const WorkerLockDir should be of the form "WorkerLockDir ..." (golint)
    • Line 170: warning: exported const DefaultTTL should have comment (or a comment on this block) or be unexported (golint)
    • jupiter/example/sentinel/main.go
    • Line 29: warning: comment on exported type Engine should be of the form "Engine ..." (with optional leading article) (golint)
    • Line 34: warning: exported function NewEngine should have comment or be unexported (golint)
    • jupiter/pkg/istats/flow_info.go
    • Line 5: warning: comment on exported type FlowInfoBase should be of the form "FlowInfoBase ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported method FlowInfoBase.UpdateShadowFlow should be of the form "UpdateShadowFlow ..." (golint)
    • Line 37: warning: exported function NewFlowInfoBase should have comment or be unexported (golint)
    • jupiter/pkg/registry/endpoint.go
    • Line 47: warning: exported method Endpoints.DeepCopy should have comment or be unexported (golint)
    • Line 57: warning: exported method Endpoints.DeepCopyInfo should have comment or be unexported (golint)
    • jupiter/pkg/conf/conf.go
    • Line 90: warning: exported method Configuration.OnLoaded should have comment or be unexported (golint)
    • Line 163: warning: comment on exported method Configuration.LoadFromReader should be of the form "LoadFromReader ..." (golint)
    • jupiter/pkg/metric/metric.go
    • Line 27: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 43: warning: exported var TypeGorm should have comment or be unexported (golint)
    • Line 52: warning: comment on exported var CodeJobSuccess should be of the form "CodeJobSuccess ..." (golint)
    • Line 59: warning: comment on exported var CodeCacheMiss should be of the form "CodeCacheMiss ..." (golint)
    • Line 64: warning: comment on exported var DefaultNamespace should be of the form "DefaultNamespace ..." (golint)
    • Line 111: warning: exported var LibHandleHistogram should have comment or be unexported (golint)
    • jupiter/example/grpc/direct/direct-server/main.go
    • Line 34: warning: exported type Engine should have comment or be unexported (golint)
    • Line 38: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 55: warning: exported type Greeter should have comment or be unexported (golint)
    • Line 57: warning: exported method Greeter.SayHello should have comment or be unexported (golint)
    • jupiter/pkg/env.go
    • Line 22: warning: exported function InitEnv should have comment or be unexported (golint)
    • Line 37: warning: exported function AppLogDir should have comment or be unexported (golint)
    • Line 41: warning: exported function SetAppLogDir should have comment or be unexported (golint)
    • Line 45: warning: exported function AppMode should have comment or be unexported (golint)
    • Line 49: warning: exported function SetAppMode should have comment or be unexported (golint)
    • Line 53: warning: exported function AppRegion should have comment or be unexported (golint)
    • Line 57: warning: exported function SetAppRegion should have comment or be unexported (golint)
    • Line 61: warning: exported function AppZone should have comment or be unexported (golint)
    • Line 65: warning: exported function SetAppZone should have comment or be unexported (golint)
    • Line 69: warning: exported function AppHost should have comment or be unexported (golint)
    • Line 73: warning: exported function SetAppHost should have comment or be unexported (golint)
    • Line 77: warning: exported function AppInstance should have comment or be unexported (golint)
    • Line 81: warning: exported function SetAppInstance should have comment or be unexported (golint)
    • jupiter/example/monitor/main.go
    • Line 36: warning: exported type Engine should have comment or be unexported (golint)
    • Line 40: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 68: warning: exported type Greeter should have comment or be unexported (golint)
    • Line 70: warning: exported method Greeter.SayHello should have comment or be unexported (golint)
    • jupiter/pkg/xlog/log.go
    • Line 50: warning: comment on exported type Field should be of the form "Field ..." (with optional leading article) (golint)
    • Line 50: warning: comment on exported type Level should be of the form "Level ..." (with optional leading article) (golint)
    • Line 50: warning: comment on exported type Logger should be of the form "Logger ..." (with optional leading article) (golint)
    • jupiter/pkg/client/rocketmq/producer.go
    • Line 29: warning: exported type Producer should have comment or be unexported (golint)
    • Line 37: warning: exported function StdNewProducer should have comment or be unexported (golint)
    • Line 41: warning: exported method ProducerConfig.Build should have comment or be unexported (golint)
    • Line 71: warning: exported method Producer.Start should have comment or be unexported (golint)
    • Line 105: warning: exported method Producer.WithInterceptor should have comment or be unexported (golint)
    • Line 110: warning: exported method Producer.Close should have comment or be unexported (golint)
    • Line 172: warning: comment on exported method Producer.SendMsg should be of the form "SendMsg ..." (golint)
    • jupiter/pkg/util/xtime/time.go
    • Line 117: warning: exported var TS should have comment or be unexported (golint)
    • Line 119: warning: exported type TimeFormat should have comment or be unexported (golint)
    • Line 121: warning: exported method TimeFormat.Format should have comment or be unexported (golint)
    • Line 126: warning: exported const DateFormat should have comment (or a comment on this block) or be unexported (golint)
    • Line 140: warning: comment on exported function CurrentTimeMillis should be of the form "CurrentTimeMillis ..." (golint)
    • Line 150: warning: comment on exported function CurrentTimeNano should be of the form "CurrentTimeNano ..." (golint)
    • jupiter/pkg/util/xdefer/stack.go
    • Line 7: warning: exported function NewStack should have comment or be unexported (golint)
    • Line 14: warning: exported type DeferStack should have comment or be unexported (golint)
    • Line 19: warning: exported method DeferStack.Push should have comment or be unexported (golint)
    • Line 25: warning: exported method DeferStack.Clean should have comment or be unexported (golint)
    • jupiter/example/config/structByFileWatch/main.go
    • Line 34: warning: exported type Engine should have comment or be unexported (golint)
    • Line 38: warning: exported type People should have comment or be unexported (golint)
    • Line 42: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 59: warning: receiver name s should be consistent with previous receiver name eng for Engine (golint)
    • jupiter/pkg/registry/init.go
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 32: warning: comment on exported var DefaultRegisterer should be of the form "DefaultRegisterer ..." (golint)
    • Line 61: warning: exported type Builder should have comment or be unexported (golint)
    • Line 63: warning: exported type BuildFunc should have comment or be unexported (golint)
    • Line 65: warning: exported function RegisterBuilder should have comment or be unexported (golint)
    • jupiter/pkg/util/xdebug/print.go
    • Line 25: warning: comment on exported function PrintObject should be of the form "PrintObject ..." (golint)
    • Line 52: warning: comment on exported function PrintKVWithPrefix should be of the form "PrintKVWithPrefix ..." (golint)
    • jupiter/pkg/util/xgo/serial.go
    • Line 32: warning: comment on exported function SerialUntilError should be of the form "SerialUntilError ..." (golint)
    • Line 45: warning: comment on exported type WhenError should be of the form "WhenError ..." (with optional leading article) (golint)
    • jupiter/example/client/redis/main.go
    • Line 24: warning: comment on exported type Engine should be of the form "Engine ..." (with optional leading article) (golint)
    • Line 29: warning: exported function NewEngine should have comment or be unexported (golint)
    • jupiter/pkg/elect/elect.go
    • Line 17: warning: exported type CallbackPhase should have comment or be unexported (golint)
    • Line 20: warning: exported const CallbackPhasePostStarted should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type LeaderElectCallback should have comment or be unexported (golint)
    • Line 26: warning: exported type LeaderElector should have comment or be unexported (golint)
    • jupiter/pkg/xlog/field.go
    • Line 25: warning: comment on exported function FieldAid should be of the form "FieldAid ..." (golint)
    • Line 30: warning: comment on exported function FieldMod should be of the form "FieldMod ..." (golint)
    • Line 36: warning: comment on exported function FieldAddr should be of the form "FieldAddr ..." (golint)
    • Line 61: warning: comment on exported function FieldCost should be of the form "FieldCost ..." (golint)
    • Line 71: warning: comment on exported function FieldKeyAny should be of the form "FieldKeyAny ..." (golint)
    • Line 96: warning: comment on exported function FieldStringErr should be of the form "FieldStringErr ..." (golint)
    • jupiter/jupiter.go
    • Line 32: warning: exported var New should have comment or be unexported (golint)
    • Line 33: warning: exported var DefaultApp should have comment or be unexported (golint)
    • jupiter/pkg/conf/option.go
    • Line 17: warning: comment on exported type GetOptions should be of the form "GetOptions ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported function TagName should be of the form "TagName ..." (golint)
    • Line 38: warning: exported function TagNameJSON should have comment or be unexported (golint)
    • Line 42: warning: exported function TagNameTOML should have comment or be unexported (golint)
    • Line 46: warning: exported function TagNameYAML should have comment or be unexported (golint)
    • Line 50: warning: exported function BuildinModule should have comment or be unexported (golint)
    • Line 57: warning: exported function Namespace should have comment or be unexported (golint)
    • Line 63: warning: exported function Module should have comment or be unexported (golint)
    • jupiter/example/trace/main.go
    • Line 28: warning: comment on exported type Engine should be of the form "Engine ..." (with optional leading article) (golint)
    • Line 33: warning: exported function NewEngine should have comment or be unexported (golint)
    • jupiter/pkg/util/xtime/rash_timer.go
    • Line 15: warning: package comment should be of the form "Package xtime ..." (golint)
    • Line 97: warning: don't use underscores in Go names; const tvn_bits should be tvnBits (golint)
    • Line 98: warning: don't use underscores in Go names; const tvr_bits should be tvrBits (golint)
    • Line 99: warning: don't use underscores in Go names; const tvn_size should be tvnSize (golint)
    • Line 100: warning: don't use underscores in Go names; const tvr_size should be tvrSize (golint)
    • Line 102: warning: don't use underscores in Go names; const tvn_mask should be tvnMask (golint)
    • Line 103: warning: don't use underscores in Go names; const tvr_mask should be tvrMask (golint)
    • jupiter/pkg/store/gorm/orm.go
    • Line 48: warning: comment on exported type StructField should be of the form "StructField ..." (with optional leading article) (golint)
    • Line 58: warning: comment on exported type Logger should be of the form "Logger ..." (with optional leading article) (golint)
    • jupiter/example/store/mongo/main.go
    • Line 32: warning: comment on exported type Engine should be of the form "Engine ..." (with optional leading article) (golint)
    • Line 37: warning: exported function NewEngine should have comment or be unexported (golint)
    • jupiter/jupiter_option.go
    • Line 7: warning: exported type Option should have comment or be unexported (golint)
    • Line 9: warning: exported type Disable should have comment or be unexported (golint)
    • Line 12: warning: exported const DisableParserFlag should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var WithConfigParser should have comment or be unexported (golint)
    • Line 18: warning: exported var WithDisable should have comment or be unexported (golint)
    • jupiter/pkg/server/server.go
    • Line 25: warning: exported type Option should have comment or be unexported (golint)
    • Line 27: warning: comment on exported type ConfigInfo should be of the form "ConfigInfo ..." (with optional leading article) (golint)
    • Line 89: warning: exported function ApplyOptions should have comment or be unexported (golint)
    • Line 97: warning: exported function WithMetaData should have comment or be unexported (golint)
    • Line 103: warning: exported function WithScheme should have comment or be unexported (golint)
    • Line 109: warning: exported function WithAddress should have comment or be unexported (golint)
    • Line 115: warning: exported function WithKind should have comment or be unexported (golint)
    • jupiter/example/grpc/etcd/etcd-server/main.go
    • Line 34: warning: exported type Engine should have comment or be unexported (golint)
    • Line 38: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 56: warning: exported type Greeter should have comment or be unexported (golint)
    • Line 60: warning: exported method Greeter.SayHello should have comment or be unexported (golint)
    • jupiter/pkg/component/component.go
    • Line 19: warning: exported type Component should have comment or be unexported (golint)
    • Line 29: warning: exported type ComponentFunc should have comment or be unexported (golint)
    • Line 31: warning: exported method ComponentFunc.Start should have comment or be unexported (golint)
    • Line 35: warning: exported method ComponentFunc.ShouldBeLeader should have comment or be unexported (golint)
    • Line 39: warning: comment on exported type Manager should be of the form "Manager ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported type Builder should be of the form "Builder ..." (with optional leading article) (golint)
    • jupiter/pkg/constant/env.go
    • Line 27: warning: exported const EnvAppID should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: comment on exported const EnvPOD_IP should be of the form "EnvPOD_IP ..." (golint)
    • Line 38: warning: don't use underscores in Go names; const EnvPOD_IP should be EnvPODIP (golint)
    • Line 39: warning: don't use underscores in Go names; const EnvPOD_NAME should be EnvPODNAME (golint)

gocyclo97%

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.


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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!