Preparing report...

Report for github.com/HouzuoGuo/tiedot

A    Great!    Found 33 issues across 48 files

Tweet

gofmt97%

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!


gocyclo72%

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.

    • tiedot/data/partition_test.go
    • Line 14: warning: cyclomatic complexity 19 of function TestPartitionDocCRUD() is high (> 15) (gocyclo)
    • Line 98: warning: cyclomatic complexity 16 of function TestApproxDocCount() is high (> 15) (gocyclo)
    • tiedot/db/db_test.go
    • Line 100: warning: cyclomatic complexity 63 of function TestColCrud() is high (> 15) (gocyclo)
    • Line 61: warning: cyclomatic complexity 19 of function TestOpenCloseDB() is high (> 15) (gocyclo)
    • Line 224: warning: cyclomatic complexity 17 of function TestDumpDB() is high (> 15) (gocyclo)
    • tiedot/db/doc_test.go
    • Line 114: warning: cyclomatic complexity 53 of function TestDocCrudAndIdx() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 30 of function GetInTest() is high (> 15) (gocyclo)

golint54%

Golint is a linter for Go source code.

    • tiedot/data/partition.go
    • Line 36: warning: comment on exported method Config.OpenPartition should be of the form "OpenPartition ..." (golint)
    • Line 92: warning: comment on exported method Partition.LockUpdate should be of the form "LockUpdate ..." (golint)
    • Line 109: warning: comment on exported method Partition.UnlockUpdate should be of the form "UnlockUpdate ..." (golint)
    • Line 129: warning: comment on exported method Partition.ForEachDoc should be of the form "ForEachDoc ..." (golint)
    • Line 143: warning: comment on exported method Partition.ApproxDocCount should be of the form "ApproxDocCount ..." (golint)
    • tiedot/db/col.go
    • Line 18: warning: exported const DOC_DATA_FILE should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: comment on exported type Col should be of the form "Col ..." (with optional leading article) (golint)
    • Line 32: warning: comment on exported function OpenCol should be of the form "OpenCol ..." (golint)
    • Line 125: warning: comment on exported method Col.ForEachDoc should be of the form "ForEachDoc ..." (golint)
    • Line 130: warning: comment on exported method Col.Index should be of the form "Index ..." (golint)
    • Line 166: warning: comment on exported method Col.AllIndexes should be of the form "AllIndexes ..." (golint)
    • Line 181: warning: comment on exported method Col.Unindex should be of the form "Unindex ..." (golint)
    • Line 214: warning: comment on exported method Col.ApproxDocCount should be of the form "ApproxDocCount ..." (golint)
    • Line 219: warning: comment on exported method Col.ForEachDocInPage should be of the form "ForEachDocInPage ..." (golint)
    • tiedot/db/db.go
    • Line 25: warning: exported const PART_NUM_FILE should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: comment on exported type DB should be of the form "DB ..." (with optional leading article) (golint)
    • Line 37: warning: comment on exported function OpenDB should be of the form "OpenDB ..." (golint)
    • Line 127: warning: comment on exported method DB.AllCols should be of the form "AllCols ..." (golint)
    • Line 255: warning: comment on exported method DB.Dump should be of the form "Dump ..." (golint)
    • tiedot/db/doc.go
    • Line 13: warning: comment on exported function GetIn should be of the form "GetIn ..." (golint)
    • Line 41: warning: comment on exported function StrHash should be of the form "StrHash ..." (golint)
    • Line 85: warning: comment on exported method Col.InsertRecovery should be of the form "InsertRecovery ..." (golint)
    • tiedot/tdlog/tdlog.go
    • Line 9: warning: comment on exported var VerboseLog should be of the form "VerboseLog ..." (golint)
    • Line 15: warning: comment on exported function Infof should be of the form "Infof ..." (golint)
    • Line 22: warning: exported function Info should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function Noticef should be of the form "Noticef ..." (golint)
    • Line 33: warning: exported function Notice should have comment or be unexported (golint)
    • Line 40: warning: comment on exported function CritNoRepeat should be of the form "CritNoRepeat ..." (golint)
    • Line 54: warning: comment on exported function Panicf should be of the form "Panicf ..." (golint)
    • tiedot/examples/example.go
    • Line 1: warning: package comment should be of the form "Package examples ..." (golint)
    • Line 23: warning: exported function EmbeddedExample should have comment or be unexported (golint)
    • tiedot/data/collection.go
    • Line 29: warning: comment on exported method Config.OpenCollection should be of the form "OpenCollection ..." (golint)
    • Line 79: warning: comment on exported method Collection.Update should be of the form "Update ..." (golint)
    • Line 129: warning: comment on exported method Collection.ForEachDoc should be of the form "ForEachDoc ..." (golint)
    • tiedot/httpapi/index.go
    • Line 12: warning: comment on exported function Index should be of the form "Index ..." (golint)
    • Line 37: warning: comment on exported function Indexes should be of the form "Indexes ..." (golint)
    • Line 64: warning: comment on exported function Unindex should be of the form "Unindex ..." (golint)
    • tiedot/httpapi/srv.go
    • Line 32: warning: exported var HttpDB should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function Require should be of the form "Require ..." (golint)
    • Line 135: warning: comment on exported function Welcome should be of the form "Welcome ..." (golint)
    • tiedot/dberr/errors.go
    • Line 8: warning: exported const ErrorNil should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: comment on exported const ErrorIO should be of the form "ErrorIO ..." (golint)
    • Line 15: warning: comment on exported const ErrorDocTooLarge should be of the form "ErrorDocTooLarge ..." (golint)
    • Line 18: warning: comment on exported const ErrorNeedIndex should be of the form "ErrorNeedIndex ..." (golint)
    • Line 25: warning: exported function New should have comment or be unexported (golint)
    • Line 29: warning: exported type Error should have comment or be unexported (golint)
    • Line 38: warning: exported function Type should have comment or be unexported (golint)
    • tiedot/data/hash64.go
    • Line 6: warning: exported const HT_FILE_GROWTH should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: comment on exported method Config.HashKey should be of the form "HashKey ..." (golint)
    • tiedot/httpapi/misc.go
    • Line 13: warning: comment on exported function Shutdown should be of the form "Shutdown ..." (golint)
    • Line 23: warning: comment on exported function Dump should be of the form "Dump ..." (golint)
    • Line 39: warning: comment on exported function MemStats should be of the form "MemStats ..." (golint)
    • Line 56: warning: comment on exported function Version should be of the form "Version ..." (golint)
    • tiedot/benchmark/benchmark.go
    • Line 92: warning: comment on exported function Benchmark should be of the form "Benchmark ..." (golint)
    • Line 154: warning: comment on exported function Benchmark2 should be of the form "Benchmark2 ..." (golint)
    • tiedot/data/file.go
    • Line 12: warning: comment on exported type DataFile should be of the form "DataFile ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported function LooksEmpty should be of the form "LooksEmpty ..." (golint)
    • Line 34: warning: comment on exported function OpenDataFile should be of the form "OpenDataFile ..." (golint)
    • Line 100: warning: comment on exported method DataFile.EnsureSize should be of the form "EnsureSize ..." (golint)
    • Line 119: warning: comment on exported method DataFile.Close should be of the form "Close ..." (golint)
    • tiedot/httpapi/jwt.go
    • Line 55: warning: comment on exported const JWT_COL_NAME should be of the form "JWT_COL_NAME ..." (golint)
    • Line 57: warning: exported const JWT_USER_ATTR should have comment (or a comment on this block) or be unexported (golint)
    • Line 62: warning: comment on exported const JWT_EXPIRY should be of the form "JWT_EXPIRY ..." (golint)
    • Line 172: warning: comment on exported type TokenExtractor should be of the form "TokenExtractor ..." (with optional leading article) (golint)
    • Line 176: warning: exported method TokenExtractor.ExtractToken should have comment or be unexported (golint)
    • tiedot/httpapi/collection.go
    • Line 28: warning: comment on exported function All should be of the form "All ..." (golint)
    • Line 79: warning: comment on exported function Scrub should be of the form "Scrub ..." (golint)
    • Line 97: warning: comment on exported function Sync should be of the form "Sync ..." (golint)
    • tiedot/httpapi/document.go
    • Line 48: warning: comment on exported function Get should be of the form "Get ..." (golint)
    • Line 84: warning: comment on exported function GetPage should be of the form "GetPage ..." (golint)
    • Line 198: warning: comment on exported function ApproxDocCount should be of the form "ApproxDocCount ..." (golint)
    • tiedot/httpapi/query.go
    • Line 14: warning: comment on exported function Query should be of the form "Query ..." (golint)
    • Line 62: warning: comment on exported function Count should be of the form "Count ..." (golint)
    • tiedot/data/config.go
    • Line 12: warning: exported const DefaultDocMaxRoom should have comment (or a comment on this block) or be unexported (golint)
    • tiedot/data/hashtable.go
    • Line 21: warning: comment on exported type HashTable should be of the form "HashTable ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported method Config.OpenHashTable should be of the form "OpenHashTable ..." (golint)
    • Line 107: warning: comment on exported method HashTable.Put should be of the form "Put ..." (golint)
    • Line 128: warning: comment on exported method HashTable.Get should be of the form "Get ..." (golint)
    • Line 158: warning: comment on exported method HashTable.Remove should be of the form "Remove ..." (golint)
    • Line 181: warning: comment on exported method Config.GetPartitionRange should be of the form "GetPartitionRange ..." (golint)
    • Line 227: warning: comment on exported method HashTable.GetPartition should be of the form "GetPartition ..." (golint)
    • tiedot/db/query.go
    • Line 15: warning: comment on exported function EvalUnion should be of the form "EvalUnion ..." (golint)
    • Line 25: warning: comment on exported function EvalAllIDs should be of the form "EvalAllIDs ..." (golint)
    • Line 34: warning: comment on exported function Lookup should be of the form "Lookup ..." (golint)
    • Line 84: warning: comment on exported function PathExistence should be of the form "PathExistence ..." (golint)
    • Line 93: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 134: warning: comment on exported function Intersect should be of the form "Intersect ..." (golint)
    • Line 166: warning: comment on exported function Complement should be of the form "Complement ..." (golint)
    • Line 205: warning: comment on exported function IntRange should be of the form "IntRange ..." (golint)
    • Line 218: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 331: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 337: warning: comment on exported function EvalQuery should be of the form "EvalQuery ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign75%

IneffAssign detects ineffectual assignments in Go code.

    • tiedot/httpapi/srv.go
    • Line 76: warning: undeclared name: jwt (ineffassign)
    • Line 80: warning: undeclared name: jwt (ineffassign)
    • Line 28: warning: "github.com/dgrijalva/jwt-go" imported but not used (ineffassign)
    • Line 76: warning: undeclared name: jwt (ineffassign)
    • Line 80: warning: undeclared name: jwt (ineffassign)
    • Line 28: warning: "github.com/dgrijalva/jwt-go" imported but not used (ineffassign)
    • tiedot/data/hashtable.go
    • Line 65: warning: bucketAddr declared but not used (ineffassign)
    • Line 92: warning: lastBucketAddr declared but not used (ineffassign)
    • Line 110: warning: entryAddr declared but not used (ineffassign)
    • Line 136: warning: entryAddr declared but not used (ineffassign)
    • Line 161: warning: entryAddr declared but not used (ineffassign)
    • Line 209: warning: entryAddr declared but not used (ineffassign)
    • Line 65: warning: bucketAddr declared but not used (ineffassign)
    • Line 92: warning: lastBucketAddr declared but not used (ineffassign)
    • Line 110: warning: entryAddr declared but not used (ineffassign)
    • Line 136: warning: entryAddr declared but not used (ineffassign)
    • Line 161: warning: entryAddr declared but not used (ineffassign)
    • Line 209: warning: entryAddr declared but not used (ineffassign)
    • tiedot/db/db.go
    • Line 21: warning: cannot find package "." in: (ineffassign)
    • Line 21: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • Line 21: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • tiedot/httpapi/jwt.go
    • Line 43: warning: cannot find package "." in: (ineffassign)
    • Line 44: warning: cannot find package "." in: (ineffassign)
    • Line 45: warning: cannot find package "." in: (ineffassign)
    • Line 46: warning: cannot find package "." in: (ineffassign)
    • Line 43: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • Line 44: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • Line 45: warning: could not import github.com/dgrijalva/jwt-go (invalid package name: "") (ineffassign)
    • Line 46: warning: could not import github.com/dgrijalva/jwt-go/request (invalid package name: "") (ineffassign)
    • Line 43: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • Line 44: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • Line 45: warning: could not import github.com/dgrijalva/jwt-go (invalid package name: "") (ineffassign)
    • Line 46: warning: could not import github.com/dgrijalva/jwt-go/request (invalid package name: "") (ineffassign)
    • tiedot/examples/example.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • tiedot/benchmark/benchmark.go
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/HouzuoGuo/tiedot/db (invalid package name: "") (ineffassign)
    • tiedot/db/col.go
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: could not import github.com/HouzuoGuo/tiedot/data (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/HouzuoGuo/tiedot/data (invalid package name: "") (ineffassign)
    • tiedot/db/query.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • tiedot/main.go
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 15: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 17: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: could not import github.com/HouzuoGuo/tiedot/benchmark (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/HouzuoGuo/tiedot/examples (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/HouzuoGuo/tiedot/httpapi (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • tiedot/data/collection.go
    • Line 20: warning: cannot find package "." in: (ineffassign)
    • Line 20: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • Line 70: warning: copySize declared but not used (ineffassign)
    • Line 101: warning: copySize declared but not used (ineffassign)
    • Line 20: warning: could not import github.com/HouzuoGuo/tiedot/dberr (invalid package name: "") (ineffassign)
    • Line 70: warning: copySize declared but not used (ineffassign)
    • Line 101: warning: copySize declared but not used (ineffassign)
    • tiedot/data/file.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/HouzuoGuo/tiedot/gommap (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/HouzuoGuo/tiedot/gommap (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/HouzuoGuo/tiedot/tdlog (invalid package name: "") (ineffassign)

misspell97%

Misspell Finds commonly misspelled English words