Preparing report...

Report for github.com/xiaoenai/ants

A+    Excellent!    Found 44 issues across 129 files

Tweet

gofmt87%

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!


gocyclo89%

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.

    • ants/model/mysql/db.go
    • Line 285: warning: cyclomatic complexity 22 of function (*CacheableDB).CacheGet() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 19 of function (*CacheableDB).CacheGetByWhere() is high (> 15) (gocyclo)
    • ants/micro/run/fsnotify/fsnotify_test.go
    • Line 850: warning: cyclomatic complexity 19 of function TestFsnotifyAttrib() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 18 of function TestFsnotifyMultipleOperations() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 17 of function TestFsnotifyMultipleCreates() is high (> 15) (gocyclo)
    • Line 304: warning: cyclomatic complexity 16 of function TestFsnotifyDirOnly() is high (> 15) (gocyclo)
    • ants/model/sqlx/sqlx.go
    • Line 893: warning: cyclomatic complexity 21 of function scanAll() is high (> 15) (gocyclo)
    • Line 114: warning: cyclomatic complexity 17 of function isUnsafe() is high (> 15) (gocyclo)

golint82%

Golint is a linter for Go source code.

    • ants/micro/run/fsnotify/fsnotify_linux.go
    • Line 25: warning: don't use underscores in Go names; const sys_IN_DONT_FOLLOW should be sysINDONTFOLLOW (golint)
    • Line 26: warning: don't use underscores in Go names; const sys_IN_ONESHOT should be sysINONESHOT (golint)
    • Line 27: warning: don't use underscores in Go names; const sys_IN_ONLYDIR should be sysINONLYDIR (golint)
    • Line 34: warning: don't use underscores in Go names; const sys_IN_ACCESS should be sysINACCESS (golint)
    • Line 35: warning: don't use underscores in Go names; const sys_IN_ALL_EVENTS should be sysINALLEVENTS (golint)
    • Line 36: warning: don't use underscores in Go names; const sys_IN_ATTRIB should be sysINATTRIB (golint)
    • Line 37: warning: don't use underscores in Go names; const sys_IN_CLOSE should be sysINCLOSE (golint)
    • Line 38: warning: don't use underscores in Go names; const sys_IN_CLOSE_NOWRITE should be sysINCLOSENOWRITE (golint)
    • Line 39: warning: don't use underscores in Go names; const sys_IN_CLOSE_WRITE should be sysINCLOSEWRITE (golint)
    • Line 40: warning: don't use underscores in Go names; const sys_IN_CREATE should be sysINCREATE (golint)
    • Line 41: warning: don't use underscores in Go names; const sys_IN_DELETE should be sysINDELETE (golint)
    • Line 42: warning: don't use underscores in Go names; const sys_IN_DELETE_SELF should be sysINDELETESELF (golint)
    • Line 43: warning: don't use underscores in Go names; const sys_IN_MODIFY should be sysINMODIFY (golint)
    • Line 44: warning: don't use underscores in Go names; const sys_IN_MOVE should be sysINMOVE (golint)
    • Line 45: warning: don't use underscores in Go names; const sys_IN_MOVED_FROM should be sysINMOVEDFROM (golint)
    • Line 46: warning: don't use underscores in Go names; const sys_IN_MOVED_TO should be sysINMOVEDTO (golint)
    • Line 47: warning: don't use underscores in Go names; const sys_IN_MOVE_SELF should be sysINMOVESELF (golint)
    • Line 48: warning: don't use underscores in Go names; const sys_IN_OPEN should be sysINOPEN (golint)
    • Line 50: warning: don't use underscores in Go names; const sys_AGNOSTIC_EVENTS should be sysAGNOSTICEVENTS (golint)
    • Line 53: warning: don't use underscores in Go names; const sys_IN_ISDIR should be sysINISDIR (golint)
    • Line 54: warning: don't use underscores in Go names; const sys_IN_IGNORED should be sysINIGNORED (golint)
    • Line 55: warning: don't use underscores in Go names; const sys_IN_Q_OVERFLOW should be sysINQOVERFLOW (golint)
    • Line 56: warning: don't use underscores in Go names; const sys_IN_UNMOUNT should be sysINUNMOUNT (golint)
    • Line 59: warning: exported type FileEvent should have comment or be unexported (golint)
    • Line 95: warning: exported type Watcher should have comment or be unexported (golint)
    • Line 189: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • ants/model/etcd/etcd.go
    • Line 1: warning: package comment should be of the form "Package etcd ..." (golint)
    • Line 108: warning: exported type CompactResponse should have comment or be unexported (golint)
    • Line 109: warning: exported type PutResponse should have comment or be unexported (golint)
    • Line 110: warning: exported type GetResponse should have comment or be unexported (golint)
    • Line 111: warning: exported type DeleteResponse should have comment or be unexported (golint)
    • Line 112: warning: exported type TxnResponse should have comment or be unexported (golint)
    • Line 209: warning: comment on exported var WithProgressNotify should be of the form "WithProgressNotify ..." (golint)
    • Line 231: warning: comment on exported var WithIgnoreValue should be of the form "WithIgnoreValue ..." (golint)
    • Line 236: warning: comment on exported var WithIgnoreLease should be of the form "WithIgnoreLease ..." (golint)
    • Line 322: warning: comment on exported type Mutex should be of the form "Mutex ..." (with optional leading article) (golint)
    • ants/gateway/logic/websocket/api.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 101: warning: comment on exported method Gw.WsKick should be of the form "WsKick ..." (golint)
    • ants/model/mysql/config.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 55: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ants/model/mongo/db.go
    • Line 19: warning: comment on exported type M should be of the form "M ..." (with optional leading article) (golint)
    • Line 21: warning: exported type Collection should have comment or be unexported (golint)
    • Line 22: warning: exported type ObjectId should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 139: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 373: warning: exported method CacheableDB.CreateGetQuery should have comment or be unexported (golint)
    • Line 384: warning: comment on exported method CacheableDB.WitchCollection should be of the form "WitchCollection ..." (golint)
    • ants/server.go
    • Line 86: warning: exported method SrvConfig.PeerConfig should have comment or be unexported (golint)
    • ants/model/redis/client.go
    • Line 1: warning: package comment should be of the form "Package redis ..." (golint)
    • Line 134: warning: comment on exported type BoolCmd should be of the form "BoolCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type BoolSliceCmd should be of the form "BoolSliceCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type ClusterSlotsCmd should be of the form "ClusterSlotsCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type Cmdable should be of the form "Cmdable ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type Cmder should be of the form "Cmder ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type DurationCmd should be of the form "DurationCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type FloatCmd should be of the form "FloatCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type GeoLocation should be of the form "GeoLocation ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type GeoRadiusQuery should be of the form "GeoRadiusQuery ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type IntCmd should be of the form "IntCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type Message should be of the form "Message ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type Pipeliner should be of the form "Pipeliner ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type RedisCmdable should be of the form "RedisCmdable ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type ScanCmd should be of the form "ScanCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type SliceCmd should be of the form "SliceCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type StatusCmd should be of the form "StatusCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type StringCmd should be of the form "StringCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type StringIntMapCmd should be of the form "StringIntMapCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type StringSliceCmd should be of the form "StringSliceCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type StringStringMapCmd should be of the form "StringStringMapCmd ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type Z should be of the form "Z ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type ZRangeBy should be of the form "ZRangeBy ..." (with optional leading article) (golint)
    • Line 134: warning: comment on exported type ZSliceCmd should be of the form "ZSliceCmd ..." (with optional leading article) (golint)
    • Line 144: warning: comment on exported type PubSub should be of the form "PubSub ..." (with optional leading article) (golint)
    • Line 261: warning: comment on exported const Nil should be of the form "Nil ..." (golint)
    • ants/micro/run/fsnotify/fsnotify.go
    • Line 11: warning: exported const FSN_CREATE should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: comment on exported method Watcher.WatchFlags should be of the form "WatchFlags ..." (golint)
    • Line 73: warning: comment on exported method Watcher.RemoveWatch should be of the form "RemoveWatch ..." (golint)
    • ants/model/mongo/config.go
    • Line 41: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 80: warning: comment on exported method Config.Source should be of the form "Source ..." (golint)
    • Line 81: warning: receiver name mgoConfig should be consistent with previous receiver name cfg for Config (golint)
    • ants/model/mongo/pre_db.go
    • Line 28: warning: exported method PreDB.Init should have comment or be unexported (golint)
    • Line 39: warning: comment on exported method PreDB.Init2 should be of the form "Init2 ..." (golint)
    • ants/doc.go
    • Line 1: warning: package comment should be of the form "Package micro ..." (golint)
    • ants/micro/create/tpl.go
    • Line 3: warning: don't use underscores in Go names; const __tpl__ should be _Tpl (golint)
    • Line 85: warning: don't use underscores in Go names; const __readme__ should be _Readme (golint)
    • Line 965: warning: don't use underscores in Go names; const __gomod__ should be _Gomod (golint)

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