Preparing report...

Report for github.com/oom-ai/oomstore

(v0.0.3)

A+    Excellent!    Found 70 issues across 122 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!


gocyclo99%

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.


golint42%

Golint is a linter for Go source code.

    • internal/database/metadata/store.go
    • Line 11: warning: exported type Store should have comment or be unexported (golint)
    • Line 18: warning: exported type ReadStore should have comment or be unexported (golint)
    • Line 39: warning: exported type WriteStore should have comment or be unexported (golint)
    • Line 60: warning: exported type SqlxContext should have comment or be unexported (golint)
    • internal/database/offline/postgres/type_tag.go
    • Line 10: warning: exported method DB.TypeTag should have comment or be unexported (golint)
    • Line 14: warning: exported function TypeTag should have comment or be unexported (golint)
    • Line 22: 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)
    • pkg/oomstore/types/feature.go
    • Line 9: warning: exported type Feature should have comment or be unexported (golint)
    • Line 23: warning: exported method Feature.Copy should have comment or be unexported (golint)
    • Line 35: warning: exported method Feature.Entity should have comment or be unexported (golint)
    • Line 39: warning: exported method Feature.OnlineRevisionID should have comment or be unexported (golint)
    • Line 43: warning: exported type FeatureList should have comment or be unexported (golint)
    • Line 45: warning: exported method FeatureList.Copy should have comment or be unexported (golint)
    • Line 56: warning: exported method FeatureList.Len should have comment or be unexported (golint)
    • Line 58: warning: exported method FeatureList.Names should have comment or be unexported (golint)
    • Line 65: warning: exported method FeatureList.IDs should have comment or be unexported (golint)
    • Line 72: warning: exported method FeatureList.Filter should have comment or be unexported (golint)
    • Line 81: warning: exported method FeatureList.Find should have comment or be unexported (golint)
    • internal/database/metadata/types.go
    • Line 5: warning: exported type RevisionRange should have comment or be unexported (golint)
    • Line 11: warning: comment on exported type CreateEntityOpt should be of the form "CreateEntityOpt ..." (with optional leading article) (golint)
    • Line 16: warning: exported type CreateFeatureOpt should have comment or be unexported (golint)
    • Line 24: warning: exported type CreateGroupOpt should have comment or be unexported (golint)
    • Line 31: warning: exported type CreateRevisionOpt should have comment or be unexported (golint)
    • Line 39: warning: comment on exported type UpdateEntityOpt should be of the form "UpdateEntityOpt ..." (with optional leading article) (golint)
    • Line 45: warning: exported type UpdateFeatureOpt should have comment or be unexported (golint)
    • Line 50: warning: exported type UpdateGroupOpt should have comment or be unexported (golint)
    • Line 56: warning: exported type UpdateRevisionOpt should have comment or be unexported (golint)
    • Line 62: warning: exported type ListFeatureOpt should have comment or be unexported (golint)
    • internal/database/dbutil/util.go
    • Line 15: warning: exported type RowMap should have comment or be unexported (golint)
    • Line 17: warning: exported const CREATE_DATA_TABLE should have comment or be unexported (golint)
    • Line 22: warning: exported function BuildFeatureDataTableSchema should have comment or be unexported (golint)
    • Line 41: warning: exported function BuildConditions should have comment or be unexported (golint)
    • Line 59: warning: exported function Quote should have comment or be unexported (golint)
    • Line 67: warning: exported function TempTable should have comment or be unexported (golint)
    • Line 85: warning: context.Context should be the first parameter of a function (golint)
    • Line 85: warning: exported function InsertRecordsToTable should have comment or be unexported (golint)
    • Line 99: warning: context.Context should be the first parameter of a function (golint)
    • Line 99: warning: exported function InsertRecordsToTableTx should have comment or be unexported (golint)
    • pkg/oomstore/group.go
    • Line 10: warning: exported method OomStore.CreateGroup should have comment or be unexported (golint)
    • Line 25: warning: exported method OomStore.GetGroup should have comment or be unexported (golint)
    • Line 29: warning: exported method OomStore.GetGroupByName should have comment or be unexported (golint)
    • Line 33: warning: exported method OomStore.ListGroup should have comment or be unexported (golint)
    • Line 37: warning: exported method OomStore.UpdateGroup should have comment or be unexported (golint)
    • pkg/oomstore/types/entity.go
    • Line 9: warning: exported type Entity should have comment or be unexported (golint)
    • Line 19: warning: exported method Entity.Copy should have comment or be unexported (golint)
    • Line 27: warning: exported type EntityList should have comment or be unexported (golint)
    • Line 29: warning: exported method EntityList.Copy should have comment or be unexported (golint)
    • Line 40: warning: exported method EntityList.Find should have comment or be unexported (golint)
    • Line 49: warning: exported method EntityList.Filter should have comment or be unexported (golint)
    • internal/database/online/test_impl/get.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 11: warning: exported function TestGetExisted should have comment or be unexported (golint)
    • Line 33: warning: exported function TestGetNotExistedEntityKey should have comment or be unexported (golint)
    • Line 49: warning: exported function TestMultiGet should have comment or be unexported (golint)
    • internal/database/online/test_impl/util.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 15: warning: exported type PrepareStoreRuntimeFunc should have comment or be unexported (golint)
    • Line 17: warning: exported type Sample should have comment or be unexported (golint)
    • Line 24: warning: exported var SampleSmall should have comment or be unexported (golint)
    • Line 25: warning: exported var SampleMedium should have comment or be unexported (golint)
    • Line 85: warning: context.Context should be the first parameter of a function (golint)
    • Line 107: warning: exported function RandString should have comment or be unexported (golint)
    • internal/database/dbutil/transaction.go
    • Line 11: warning: comment on exported type TxFn should be of the form "TxFn ..." (with optional leading article) (golint)
    • Line 15: warning: context.Context should be the first parameter of a function (golint)
    • Line 15: warning: exported function WithTransaction should have comment or be unexported (golint)
    • internal/database/online/redis/util.go
    • Line 11: warning: exported function SerializeByTag should have comment or be unexported (golint)
    • Line 28: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 41: warning: exported function SerializeByValue should have comment or be unexported (golint)
    • Line 80: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 89: warning: exported function DeserializeByTag should have comment or be unexported (golint)
    • Line 130: warning: exported function SerializeRedisKey should have comment or be unexported (golint)
    • pkg/oomstore/types/options.go
    • Line 7: warning: exported type CreateFeatureOpt should have comment or be unexported (golint)
    • Line 14: warning: exported type ListFeatureOpt should have comment or be unexported (golint)
    • Line 20: warning: exported type UpdateFeatureOpt should have comment or be unexported (golint)
    • Line 25: warning: exported type CreateEntityOpt should have comment or be unexported (golint)
    • Line 31: warning: exported type CreateGroupOpt should have comment or be unexported (golint)
    • Line 37: warning: exported type ExportFeatureValuesOpt should have comment or be unexported (golint)
    • Line 43: warning: exported type ImportOpt should have comment or be unexported (golint)
    • Line 50: warning: exported type CsvDataSource should have comment or be unexported (golint)
    • Line 55: warning: exported type OnlineGetOpt should have comment or be unexported (golint)
    • Line 60: warning: exported type OnlineMultiGetOpt should have comment or be unexported (golint)
    • Line 65: warning: exported type JoinOpt should have comment or be unexported (golint)
    • Line 70: warning: exported type UpdateEntityOpt should have comment or be unexported (golint)
    • Line 75: warning: exported type UpdateGroupOpt should have comment or be unexported (golint)
    • Line 81: warning: exported type SyncOpt should have comment or be unexported (golint)
    • pkg/oomstore/types/revision.go
    • Line 7: warning: exported type Revision should have comment or be unexported (golint)
    • Line 21: warning: exported method Revision.Copy should have comment or be unexported (golint)
    • Line 33: warning: exported type RevisionList should have comment or be unexported (golint)
    • Line 35: warning: exported method RevisionList.Copy should have comment or be unexported (golint)
    • Line 46: warning: exported method RevisionList.Find should have comment or be unexported (golint)
    • Line 55: warning: exported method RevisionList.Filter should have comment or be unexported (golint)
    • internal/database/metadata/test_impl/group.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 13: warning: context.Context should be the first parameter of a function (golint)
    • Line 25: warning: exported function TestGetGroup should have comment or be unexported (golint)
    • Line 55: warning: exported function TestListGroup should have comment or be unexported (golint)
    • Line 95: warning: exported function TestCreateGroup should have comment or be unexported (golint)
    • Line 123: warning: exported function TestUpdateGroup should have comment or be unexported (golint)
    • pkg/oomstore/feature.go
    • Line 11: warning: exported method OomStore.GetFeature should have comment or be unexported (golint)
    • Line 15: warning: exported method OomStore.GetFeatureByName should have comment or be unexported (golint)
    • Line 19: warning: exported method OomStore.ListFeature should have comment or be unexported (golint)
    • Line 40: warning: exported method OomStore.UpdateFeature should have comment or be unexported (golint)
    • Line 51: warning: exported method OomStore.CreateBatchFeature should have comment or be unexported (golint)
    • pkg/oomstore/revision.go
    • Line 9: warning: exported method OomStore.ListRevision should have comment or be unexported (golint)
    • Line 13: warning: exported method OomStore.GetRevision should have comment or be unexported (golint)
    • Line 17: warning: exported method OomStore.GetRevisionBy should have comment or be unexported (golint)
    • pkg/oomstore/types/types.go
    • Line 4: warning: exported const BatchFeatureCategory should have comment (or a comment on this block) or be unexported (golint)
    • Line 8: warning: exported type FeatureKV should have comment or be unexported (golint)
    • Line 13: warning: exported function NewFeatureKV should have comment or be unexported (golint)
    • Line 20: warning: exported type FeatureDataSet should have comment or be unexported (golint)
    • Line 22: warning: exported function NewFeatureDataSet should have comment or be unexported (golint)
    • Line 26: warning: exported type RawFeatureValueRecord should have comment or be unexported (golint)
    • Line 31: warning: exported method RawFeatureValueRecord.EntityKey should have comment or be unexported (golint)
    • Line 35: warning: exported method RawFeatureValueRecord.ValueAt should have comment or be unexported (golint)
    • Line 39: warning: exported type EntityRow should have comment or be unexported (golint)
    • Line 44: warning: exported type JoinResult should have comment or be unexported (golint)
    • internal/database/metadata/postgres/tx.go
    • Line 9: warning: exported method Tx.CreateEntity should have comment or be unexported (golint)
    • Line 13: warning: exported method Tx.UpdateEntity should have comment or be unexported (golint)
    • Line 17: warning: exported method Tx.CreateGroup should have comment or be unexported (golint)
    • Line 21: warning: exported method Tx.UpdateGroup should have comment or be unexported (golint)
    • Line 25: warning: exported method Tx.CreateFeature should have comment or be unexported (golint)
    • Line 29: warning: exported method Tx.UpdateFeature should have comment or be unexported (golint)
    • Line 33: warning: exported method Tx.CreateRevision should have comment or be unexported (golint)
    • Line 37: warning: exported method Tx.UpdateRevision should have comment or be unexported (golint)
    • internal/database/metadata/test_impl/entity.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 13: warning: exported function TestCreateEntity should have comment or be unexported (golint)
    • Line 37: warning: exported function TestGetEntity should have comment or be unexported (golint)
    • Line 64: warning: exported function TestUpdateEntity should have comment or be unexported (golint)
    • Line 94: warning: exported function TestListEntity should have comment or be unexported (golint)
    • internal/database/metadata/test_impl/revision.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 15: warning: exported function TestCreateRevision should have comment or be unexported (golint)
    • Line 96: warning: exported function TestUpdateRevision should have comment or be unexported (golint)
    • Line 144: warning: exported function TestGetRevision should have comment or be unexported (golint)
    • Line 206: warning: exported function TestGetRevisionBy should have comment or be unexported (golint)
    • Line 278: warning: exported function TestListRevision should have comment or be unexported (golint)
    • Line 323: warning: context.Context should be the first parameter of a function (golint)
    • pkg/oomstore/entity.go
    • Line 10: warning: exported method OomStore.GetEntity should have comment or be unexported (golint)
    • Line 14: warning: exported method OomStore.GetEntityByName should have comment or be unexported (golint)
    • Line 18: warning: exported method OomStore.ListEntity should have comment or be unexported (golint)
    • Line 22: warning: exported method OomStore.CreateEntity should have comment or be unexported (golint)
    • Line 28: warning: exported method OomStore.UpdateEntity should have comment or be unexported (golint)
    • internal/database/online/redis/database.go
    • Line 11: warning: exported const PipelineBatchSize should have comment or be unexported (golint)
    • Line 12: warning: exported const SerializeIntBase should have comment or be unexported (golint)
    • Line 16: warning: exported type DB should have comment or be unexported (golint)
    • Line 20: warning: exported function Open should have comment or be unexported (golint)
    • internal/database/offline/types.go
    • Line 10: warning: exported type ExportOpt should have comment or be unexported (golint)
    • Line 17: warning: exported type JoinOpt should have comment or be unexported (golint)
    • Line 24: warning: exported type JoinOneGroupOpt should have comment or be unexported (golint)
    • Line 32: warning: exported type ImportOpt should have comment or be unexported (golint)
    • pkg/oomstore/types/config.go
    • Line 3: warning: exported type BackendType should have comment or be unexported (golint)
    • Line 6: warning: exported const POSTGRES should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: exported type OomStoreConfig should have comment or be unexported (golint)
    • Line 16: warning: exported type OnlineStoreConfig should have comment or be unexported (golint)
    • Line 22: warning: exported type OfflineStoreConfig should have comment or be unexported (golint)
    • Line 27: warning: exported type MetadataStoreConfig should have comment or be unexported (golint)
    • Line 32: warning: exported type RedisOpt should have comment or be unexported (golint)
    • Line 39: warning: exported type PostgresOpt should have comment or be unexported (golint)
    • internal/database/online/postgres/database.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported type DB should have comment or be unexported (golint)
    • Line 19: warning: exported function OpenWith should have comment or be unexported (golint)
    • Line 32: warning: exported function Open should have comment or be unexported (golint)
    • pkg/oomstore/online_query.go
    • Line 13: warning: exported method OomStore.OnlineGet should have comment or be unexported (golint)
    • Line 56: warning: exported method OomStore.OnlineMultiGet should have comment or be unexported (golint)
    • internal/database/online/types.go
    • Line 7: warning: exported type GetOpt should have comment or be unexported (golint)
    • Line 14: warning: exported type MultiGetOpt should have comment or be unexported (golint)
    • Line 21: warning: exported type ImportOpt should have comment or be unexported (golint)
    • internal/database/offline/postgres/database.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported type DB should have comment or be unexported (golint)
    • Line 19: warning: exported function Open should have comment or be unexported (golint)
    • Line 23: warning: exported function OpenWith should have comment or be unexported (golint)
    • internal/database/online/test_impl/purge.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported function TestPurgeRemovesSpecifiedRevision should have comment or be unexported (golint)
    • Line 30: warning: exported function TestPurgeNotRemovesOtherRevisions should have comment or be unexported (golint)
    • internal/database/metadata/informer/feature.go
    • Line 8: warning: exported type FeatureCache should have comment or be unexported (golint)
    • Line 12: warning: exported method FeatureCache.Enrich should have comment or be unexported (golint)
    • Line 20: warning: exported method FeatureCache.List should have comment or be unexported (golint)
    • internal/database/metadata/informer/informer.go
    • Line 14: warning: exported type Cache should have comment or be unexported (golint)
    • Line 21: warning: exported function NewCache should have comment or be unexported (golint)
    • Line 41: warning: exported type Informer should have comment or be unexported (golint)
    • Line 48: warning: exported function New should have comment or be unexported (golint)
    • Line 75: warning: exported method Informer.Close should have comment or be unexported (golint)
    • Line 81: warning: exported method Informer.Refresh should have comment or be unexported (golint)
    • Line 91: warning: exported method Informer.Cache should have comment or be unexported (golint)
    • Line 95: warning: comment on exported method Informer.GetEntity should be of the form "GetEntity ..." (golint)
    • Line 101: 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 106: warning: exported method Informer.GetEntityByName should have comment or be unexported (golint)
    • Line 111: 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 116: warning: exported method Informer.GetFeature should have comment or be unexported (golint)
    • Line 121: 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 126: warning: exported method Informer.GetFeatureByName should have comment or be unexported (golint)
    • Line 131: 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 136: warning: exported method Informer.GetGroup should have comment or be unexported (golint)
    • Line 141: 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 146: warning: exported method Informer.GetGroupByName should have comment or be unexported (golint)
    • Line 151: 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 156: warning: exported method Informer.GetRevision should have comment or be unexported (golint)
    • Line 161: 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 166: warning: exported method Informer.GetRevisionBy should have comment or be unexported (golint)
    • Line 171: 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 176: warning: comment on exported method Informer.ListEntity should be of the form "ListEntity ..." (golint)
    • Line 181: warning: exported method Informer.ListFeature should have comment or be unexported (golint)
    • Line 185: warning: exported method Informer.ListGroup should have comment or be unexported (golint)
    • Line 189: warning: exported method Informer.ListRevision should have comment or be unexported (golint)
    • internal/database/metadata/informer/revision.go
    • Line 7: warning: exported type RevisionCache should have comment or be unexported (golint)
    • Line 11: warning: exported method RevisionCache.Enrich should have comment or be unexported (golint)
    • Line 19: warning: exported method RevisionCache.List should have comment or be unexported (golint)
    • internal/database/metadata/postgres/database.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 20: warning: exported type DB should have comment or be unexported (golint)
    • Line 25: warning: exported type Tx should have comment or be unexported (golint)
    • Line 29: warning: exported function Open should have comment or be unexported (golint)
    • Line 46: warning: exported function OpenDB should have comment or be unexported (golint)
    • Line 58: warning: exported method DB.Close should have comment or be unexported (golint)
    • Line 96: warning: exported method DB.WithTransaction should have comment or be unexported (golint)
    • Line 121: warning: exported method Tx.WithTransaction should have comment or be unexported (golint)
    • internal/database/metadata/postgres/db.go
    • Line 9: warning: exported method DB.CreateEntity should have comment or be unexported (golint)
    • Line 13: warning: exported method DB.UpdateEntity should have comment or be unexported (golint)
    • Line 17: warning: exported method DB.CreateGroup should have comment or be unexported (golint)
    • Line 21: warning: exported method DB.UpdateGroup should have comment or be unexported (golint)
    • Line 25: warning: exported method DB.CreateFeature should have comment or be unexported (golint)
    • Line 29: warning: exported method DB.UpdateFeature should have comment or be unexported (golint)
    • Line 33: warning: exported method DB.CreateRevision should have comment or be unexported (golint)
    • Line 46: warning: exported method DB.UpdateRevision should have comment or be unexported (golint)
    • pkg/oomstore/types/group.go
    • Line 9: warning: exported type Group should have comment or be unexported (golint)
    • Line 24: warning: exported method Group.Copy should have comment or be unexported (golint)
    • Line 39: warning: exported type GroupList should have comment or be unexported (golint)
    • Line 41: warning: exported method GroupList.Copy should have comment or be unexported (golint)
    • Line 52: warning: exported method GroupList.Find should have comment or be unexported (golint)
    • Line 61: warning: exported method GroupList.Filter should have comment or be unexported (golint)
    • internal/database/database.go
    • Line 20: warning: exported function OpenOnlineStore should have comment or be unexported (golint)
    • Line 31: warning: exported function OpenMetadataStore should have comment or be unexported (golint)
    • Line 40: warning: exported function CreateMetadataDatabase should have comment or be unexported (golint)
    • Line 49: warning: exported function OpenOfflineStore should have comment or be unexported (golint)
    • internal/database/metadata/informer/group.go
    • Line 7: warning: exported type GroupCache should have comment or be unexported (golint)
    • Line 11: warning: exported method GroupCache.Enrich should have comment or be unexported (golint)
    • Line 19: warning: exported method GroupCache.List should have comment or be unexported (golint)
    • internal/database/metadata/postgres/schema.go
    • Line 3: warning: exported var DB_FUNCTIONS should have comment or be unexported (golint)
    • Line 14: warning: exported var TRIGGER_TEMPLATE should have comment or be unexported (golint)
    • Line 21: warning: exported var META_TABLE_SCHEMAS should have comment or be unexported (golint)
    • Line 80: warning: exported var META_TABLE_FOREIGN_KEYS should have comment or be unexported (golint)
    • Line 104: warning: exported var META_VIEW_SCHEMAS should have comment or be unexported (golint)
    • pkg/oomstore/oomstore.go
    • Line 15: warning: exported type OomStore should have comment or be unexported (golint)
    • Line 21: warning: exported function TEST__New should have comment or be unexported (golint)
    • Line 21: warning: don't use underscores in Go names; func TEST__New should be TESTNew (golint)
    • Line 29: warning: exported function Open should have comment or be unexported (golint)
    • Line 50: warning: exported function Create should have comment or be unexported (golint)
    • Line 57: warning: exported method OomStore.Close should have comment or be unexported (golint)
    • internal/database/metadata/test_impl/feature.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: context.Context should be the first parameter of a function (golint)
    • Line 35: warning: exported function TestCreateFeature should have comment or be unexported (golint)
    • Line 52: warning: exported function TestCreateFeatureWithSameName should have comment or be unexported (golint)
    • Line 70: warning: exported function TestCreateFeatureWithSQLKeywrod should have comment or be unexported (golint)
    • Line 86: warning: exported function TestCreateFeatureWithInvalidDataType should have comment or be unexported (golint)
    • Line 99: warning: exported function TestGetFeature should have comment or be unexported (golint)
    • Line 126: warning: exported function TestListFeature should have comment or be unexported (golint)
    • Line 171: warning: exported function TestUpdateFeature should have comment or be unexported (golint)
    • featctl/cmd/util.go
    • Line 12: warning: exported const CSV should have comment (or a comment on this block) 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!