Preparing report...

Report for github.com/donnol/jdnote

A+    Excellent!    Found 64 issues across 140 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!


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!


golint55%

Golint is a linter for Go source code.

    • jdnote/utils/search/sonic/sonic.go
    • Line 9: warning: exported type Client should have comment or be unexported (golint)
    • Line 15: warning: exported type Option should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • Line 38: warning: exported method Client.BulkPush should have comment or be unexported (golint)
    • Line 58: warning: exported method Client.Query should have comment or be unexported (golint)
    • jdnote/models/notemodel/enum.go
    • Line 3: warning: exported type Status should have comment or be unexported (golint)
    • Line 6: warning: exported const StatusUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported method Status.IsValid should have comment or be unexported (golint)
    • Line 19: warning: exported method Status.IsPublish should have comment or be unexported (golint)
    • jdnote/utils/timer/timer.go
    • Line 10: warning: exported type Job should have comment or be unexported (golint)
    • Line 12: warning: exported type FuncJob should have comment or be unexported (golint)
    • Line 14: warning: exported function WithTimeConsuming should have comment or be unexported (golint)
    • jdnote/stores/notestore/mock.go
    • Line 11: warning: exported type NoterMock should have comment or be unexported (golint)
    • Line 36: warning: exported var NoterMockAddProxyContext should have comment or be unexported (golint)
    • Line 78: warning: exported method NoterMock.Add should have comment or be unexported (golint)
    • Line 82: warning: exported method NoterMock.AddOne should have comment or be unexported (golint)
    • Line 86: warning: exported method NoterMock.Del should have comment or be unexported (golint)
    • Line 90: warning: exported method NoterMock.Get should have comment or be unexported (golint)
    • Line 94: warning: exported method NoterMock.GetList should have comment or be unexported (golint)
    • Line 98: warning: exported method NoterMock.GetPage should have comment or be unexported (golint)
    • Line 102: warning: exported method NoterMock.Mod should have comment or be unexported (golint)
    • Line 106: warning: exported method NoterMock.ModStatus should have comment or be unexported (golint)
    • jdnote/services/usersrv/mock.go
    • Line 9: warning: exported type UserMock should have comment or be unexported (golint)
    • Line 25: warning: exported method UserMock.Add should have comment or be unexported (golint)
    • Line 29: warning: exported method UserMock.Check should have comment or be unexported (golint)
    • Line 33: warning: exported method UserMock.GetByID should have comment or be unexported (golint)
    • Line 37: warning: exported method UserMock.GetByName should have comment or be unexported (golint)
    • Line 41: warning: exported method UserMock.GetFirst should have comment or be unexported (golint)
    • Line 45: warning: exported method UserMock.VerifyByNameAndPassword should have comment or be unexported (golint)
    • jdnote/api/noteapi/front.go
    • Line 10: warning: exported type Front should have comment or be unexported (golint)
    • Line 17: warning: exported method Front.GetPage should have comment or be unexported (golint)
    • Line 39: warning: exported method Front.Get should have comment or be unexported (golint)
    • jdnote/utils/store/minio/minio.go
    • Line 12: warning: exported type Client should have comment or be unexported (golint)
    • Line 16: warning: exported type Option should have comment or be unexported (golint)
    • Line 23: warning: exported function New should have comment or be unexported (golint)
    • Line 39: warning: exported method Client.MakeBucket should have comment or be unexported (golint)
    • Line 47: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 55: warning: exported type PutOption should have comment or be unexported (golint)
    • Line 63: warning: exported method Client.PutObject should have comment or be unexported (golint)
    • Line 73: warning: exported type GetOption should have comment or be unexported (golint)
    • Line 78: warning: exported method Client.GetObject should have comment or be unexported (golint)
    • jdnote/services/filesrv/file_data.go
    • Line 8: warning: exported type GetParam should have comment or be unexported (golint)
    • Line 12: warning: exported type GetResult should have comment or be unexported (golint)
    • Line 17: warning: exported type AddParam should have comment or be unexported (golint)
    • Line 22: warning: exported type AddResult should have comment or be unexported (golint)
    • jdnote/services/authsrv/mock.go
    • Line 5: warning: exported type AuthMock should have comment or be unexported (golint)
    • Line 17: warning: exported method AuthMock.CheckLogin should have comment or be unexported (golint)
    • Line 21: warning: exported method AuthMock.CheckPerm should have comment or be unexported (golint)
    • Line 25: warning: exported method AuthMock.CheckUserExist should have comment or be unexported (golint)
    • Line 29: warning: exported method AuthMock.CheckUserPerm should have comment or be unexported (golint)
    • jdnote/utils/common/enum.go
    • Line 3: warning: exported type Type should have comment or be unexported (golint)
    • Line 5: warning: exported type Status should have comment or be unexported (golint)
    • Line 7: warning: exported type Flag should have comment or be unexported (golint)
    • jdnote/stores/userrolestore/mock.go
    • Line 9: warning: exported type UserRoleMock should have comment or be unexported (golint)
    • Line 17: warning: exported method UserRoleMock.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method UserRoleMock.GetByUserID should have comment or be unexported (golint)
    • jdnote/internal/initializers/app.go
    • Line 30: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 60: warning: exported function New should have comment or be unexported (golint)
    • Line 154: warning: exported method App.GetConfig should have comment or be unexported (golint)
    • Line 178: warning: exported method App.Logger should have comment or be unexported (golint)
    • Line 182: warning: exported method App.Trigger should have comment or be unexported (golint)
    • Line 186: warning: exported method App.Router should have comment or be unexported (golint)
    • Line 190: warning: exported type ProviderOption should have comment or be unexported (golint)
    • Line 195: warning: exported method App.RegisterArounderMap should have comment or be unexported (golint)
    • Line 199: warning: exported method App.MustRegisterProvider should have comment or be unexported (golint)
    • Line 208: warning: exported method App.MustInject should have comment or be unexported (golint)
    • Line 214: warning: exported method App.RegisterRouterWithInject should have comment or be unexported (golint)
    • Line 223: warning: exported method App.StaticFS should have comment or be unexported (golint)
    • Line 227: warning: exported method App.RegisterTimerHandler should have comment or be unexported (golint)
    • Line 237: warning: exported method App.RunTimer should have comment or be unexported (golint)
    • Line 243: warning: exported method App.StopTimer should have comment or be unexported (golint)
    • Line 247: warning: exported method App.RunPprof should have comment or be unexported (golint)
    • Line 260: warning: exported method App.RunPrometheus should have comment or be unexported (golint)
    • Line 274: warning: exported method App.RunMetrics should have comment or be unexported (golint)
    • Line 346: warning: exported method App.Run should have comment or be unexported (golint)
    • Line 372: warning: exported method App.ShutdownServer should have comment or be unexported (golint)
    • Line 376: warning: exported method App.Cancel should have comment or be unexported (golint)
    • jdnote/internal/initializers/env.go
    • Line 6: warning: exported const ProjectEnv should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported function GetProjectEnv should have comment or be unexported (golint)
    • jdnote/utils/store/redis/redis.go
    • Line 7: warning: exported type Options should have comment or be unexported (golint)
    • Line 9: warning: exported type XAddArgs should have comment or be unexported (golint)
    • Line 11: warning: exported type XReadArgs should have comment or be unexported (golint)
    • Line 13: warning: exported type XReadGroupArgs should have comment or be unexported (golint)
    • jdnote/stores/rolestore/mock.go
    • Line 9: warning: exported type RoleMock should have comment or be unexported (golint)
    • Line 17: warning: exported method RoleMock.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method RoleMock.GetByID should have comment or be unexported (golint)
    • jdnote/services/filesrv/mock.go
    • Line 5: warning: exported type FileMock should have comment or be unexported (golint)
    • Line 13: warning: exported method FileMock.Add should have comment or be unexported (golint)
    • Line 17: warning: exported method FileMock.Get should have comment or be unexported (golint)
    • jdnote/services/timesrv/mock.go
    • Line 5: warning: exported type TimeMock should have comment or be unexported (golint)
    • Line 13: warning: exported method TimeMock.ToTime should have comment or be unexported (golint)
    • Line 17: warning: exported method TimeMock.ToUnix should have comment or be unexported (golint)
    • jdnote/utils/process/atomic_processor.go
    • Line 9: warning: exported type AtomicProcessor should have comment or be unexported (golint)
    • Line 16: warning: exported type Rollbacker should have comment or be unexported (golint)
    • Line 55: warning: exported function WrapRecover should have comment or be unexported (golint)
    • Line 74: warning: exported type Func should have comment or be unexported (golint)
    • Line 76: warning: exported type RollbackerList should have comment or be unexported (golint)
    • Line 78: warning: exported method RollbackerList.Rollback should have comment or be unexported (golint)
    • jdnote/utils/flow/mock.go
    • Line 5: warning: exported type FlowMock should have comment or be unexported (golint)
    • Line 17: warning: exported method FlowMock.Cleanup should have comment or be unexported (golint)
    • Line 21: warning: exported method FlowMock.Do should have comment or be unexported (golint)
    • Line 25: warning: exported method FlowMock.Finish should have comment or be unexported (golint)
    • Line 29: warning: exported method FlowMock.Prepare should have comment or be unexported (golint)
    • Line 33: warning: exported type HookMock should have comment or be unexported (golint)
    • Line 41: warning: exported method HookMock.Do should have comment or be unexported (golint)
    • Line 45: warning: exported method HookMock.When should have comment or be unexported (golint)
    • jdnote/stores/userstore/interface.go
    • Line 10: warning: exported type IUser should have comment or be unexported (golint)
    • Line 18: warning: exported type IEntity should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • jdnote/utils/queue/queue.go
    • Line 10: warning: exported type Topic should have comment or be unexported (golint)
    • Line 12: warning: exported type Func should have comment or be unexported (golint)
    • Line 14: warning: exported type Param should have comment or be unexported (golint)
    • Line 18: warning: exported type Option should have comment or be unexported (golint)
    • Line 22: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 27: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 86: warning: exported type Queue should have comment or be unexported (golint)
    • jdnote/utils/queue/mock.go
    • Line 5: warning: exported type TriggerMock should have comment or be unexported (golint)
    • Line 13: warning: exported method TriggerMock.Publish should have comment or be unexported (golint)
    • Line 17: warning: exported method TriggerMock.Subscribe should have comment or be unexported (golint)
    • Line 21: warning: exported type QueueMock should have comment or be unexported (golint)
    • Line 29: warning: exported method QueueMock.Dequeue should have comment or be unexported (golint)
    • Line 33: warning: exported method QueueMock.Enqueue should have comment or be unexported (golint)
    • jdnote/utils/exp/mock.go
    • Line 3: warning: exported type DBMock should have comment or be unexported (golint)
    • Line 9: warning: exported method DBMock.Get should have comment or be unexported (golint)
    • jdnote/stores/roleactionstore/mock.go
    • Line 9: warning: exported type RoleActionMock should have comment or be unexported (golint)
    • Line 17: warning: exported method RoleActionMock.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method RoleActionMock.CheckPerm should have comment or be unexported (golint)
    • jdnote/utils/store/influx/influx.go
    • Line 7: warning: exported type Client should have comment or be unexported (golint)
    • Line 11: warning: exported type Option should have comment or be unexported (golint)
    • Line 16: warning: exported type BucketSetting should have comment or be unexported (golint)
    • Line 21: warning: exported function Open should have comment or be unexported (golint)
    • jdnote/models/filemodel/file.go
    • Line 29: warning: exported type FileInputData should have comment or be unexported (golint)
    • Line 33: warning: exported type FileDeriveData should have comment or be unexported (golint)
    • Line 37: warning: exported method FileData.Filter should have comment or be unexported (golint)
    • jdnote/api/timeapi/time.go
    • Line 11: warning: exported type Time should have comment or be unexported (golint)
    • Line 15: warning: exported method Time.GetToUnix should have comment or be unexported (golint)
    • Line 28: warning: exported method Time.GetToTime should have comment or be unexported (golint)
    • jdnote/utils/store/db/mock.go
    • Line 10: warning: exported type DBMock should have comment or be unexported (golint)
    • Line 56: warning: exported method DBMock.BindNamed should have comment or be unexported (golint)
    • Line 60: warning: exported method DBMock.DriverName should have comment or be unexported (golint)
    • Line 64: warning: exported method DBMock.Get should have comment or be unexported (golint)
    • Line 68: warning: exported method DBMock.GetContext should have comment or be unexported (golint)
    • Line 72: warning: exported method DBMock.MustExec should have comment or be unexported (golint)
    • Line 76: warning: exported method DBMock.MustExecContext should have comment or be unexported (golint)
    • Line 80: warning: exported method DBMock.NamedExec should have comment or be unexported (golint)
    • Line 84: warning: exported method DBMock.NamedExecContext should have comment or be unexported (golint)
    • Line 88: warning: exported method DBMock.NamedQuery should have comment or be unexported (golint)
    • Line 92: warning: exported method DBMock.PrepareNamed should have comment or be unexported (golint)
    • Line 96: warning: exported method DBMock.PrepareNamedContext should have comment or be unexported (golint)
    • Line 100: warning: exported method DBMock.Preparex should have comment or be unexported (golint)
    • Line 104: warning: exported method DBMock.PreparexContext should have comment or be unexported (golint)
    • Line 108: warning: exported method DBMock.QueryContext should have comment or be unexported (golint)
    • Line 112: warning: exported method DBMock.QueryRowx should have comment or be unexported (golint)
    • Line 116: warning: exported method DBMock.QueryRowxContext should have comment or be unexported (golint)
    • Line 120: warning: exported method DBMock.Queryx should have comment or be unexported (golint)
    • Line 124: warning: exported method DBMock.QueryxContext should have comment or be unexported (golint)
    • Line 128: warning: exported method DBMock.Rebind should have comment or be unexported (golint)
    • Line 132: warning: exported method DBMock.Select should have comment or be unexported (golint)
    • Line 136: warning: exported method DBMock.SelectContext should have comment or be unexported (golint)
    • jdnote/stores/actionstore/mock.go
    • Line 9: warning: exported type ActionMock should have comment or be unexported (golint)
    • Line 17: warning: exported method ActionMock.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method ActionMock.GetByID should have comment or be unexported (golint)
    • jdnote/utils/cache/cache.go
    • Line 11: warning: exported type Cache should have comment or be unexported (golint)
    • Line 16: warning: exported type Option should have comment or be unexported (golint)
    • Line 20: warning: exported function New should have comment or be unexported (golint)
    • jdnote/stores/filestore/mock.go
    • Line 9: warning: exported type FileMock should have comment or be unexported (golint)
    • Line 21: warning: exported method FileMock.Add should have comment or be unexported (golint)
    • Line 25: warning: exported method FileMock.AddContent should have comment or be unexported (golint)
    • Line 29: warning: exported method FileMock.Get should have comment or be unexported (golint)
    • Line 33: warning: exported method FileMock.GetContentByIDs should have comment or be unexported (golint)
    • jdnote/stores/userstore/mock.go
    • Line 10: warning: exported type UserMock should have comment or be unexported (golint)
    • Line 29: warning: exported var UserMockAddProxyContext should have comment or be unexported (golint)
    • Line 56: warning: exported method UserMock.Add should have comment or be unexported (golint)
    • Line 60: warning: exported method UserMock.GetByID should have comment or be unexported (golint)
    • Line 64: warning: exported method UserMock.GetByName should have comment or be unexported (golint)
    • Line 68: warning: exported method UserMock.GetFirst should have comment or be unexported (golint)
    • Line 72: warning: exported method UserMock.VerifyByNameAndPassword should have comment or be unexported (golint)
    • Line 76: warning: exported type EntityMock should have comment or be unexported (golint)
    • Line 87: warning: exported var EntityMockFilterProxyContext should have comment or be unexported (golint)
    • Line 94: warning: exported method EntityMock.Filter should have comment or be unexported (golint)
    • jdnote/utils/config/config.go
    • Line 35: warning: exported type Pprof should have comment or be unexported (golint)
    • Line 39: warning: exported type Prometheus should have comment or be unexported (golint)
    • Line 43: warning: exported type Port should have comment or be unexported (golint)
    • Line 45: warning: exported method Port.Raw should have comment or be unexported (golint)
    • Line 53: warning: exported method Port.ToAddr should have comment or be unexported (golint)
    • Line 73: warning: exported type Redis should have comment or be unexported (golint)
    • jdnote/utils/store/db/helper.go
    • Line 11: warning: exported type TxKeyType should have comment or be unexported (golint)
    • Line 15: warning: exported const TxKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported function MustGetDBFromCtxValue should have comment or be unexported (golint)
    • Line 38: warning: exported function WithTx should have comment or be unexported (golint)
    • jdnote/api/noteapi/note.go
    • Line 118: warning: exported method Note.ModPublish should have comment or be unexported (golint)
    • Line 141: warning: exported method Note.ModHide should have comment or be unexported (golint)
    • jdnote/services/notesrv/mock.go
    • Line 10: warning: exported type NoteMock should have comment or be unexported (golint)
    • Line 37: warning: exported var NoteMockAddOneProxyContext should have comment or be unexported (golint)
    • Line 84: warning: exported method NoteMock.AddOne should have comment or be unexported (golint)
    • Line 88: warning: exported method NoteMock.Del should have comment or be unexported (golint)
    • Line 92: warning: exported method NoteMock.Get should have comment or be unexported (golint)
    • Line 96: warning: exported method NoteMock.GetPage should have comment or be unexported (golint)
    • Line 100: warning: exported method NoteMock.GetPublish should have comment or be unexported (golint)
    • Line 104: warning: exported method NoteMock.Hide should have comment or be unexported (golint)
    • Line 108: warning: exported method NoteMock.Mod should have comment or be unexported (golint)
    • Line 112: warning: exported method NoteMock.Publish should have comment or be unexported (golint)
    • Line 116: warning: exported method NoteMock.Timer 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!