Preparing report...

Report for github.com/pilosa/pilosa

A+    Excellent!    Found 67 issues across 187 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!


golint79%

Golint is a linter for Go source code.

    • pilosa/test/field.go
    • Line 77: warning: comment on exported function TestField_SetCacheSize should be of the form "TestField_SetCacheSize ..." (golint)
    • Line 78: warning: don't use underscores in Go names; func TestField_SetCacheSize should be TestFieldSetCacheSize (golint)
    • pilosa/http/handler.go
    • Line 83: warning: exported function OptHandlerAllowedOrigins should have comment or be unexported (golint)
    • Line 93: warning: exported function OptHandlerAPI should have comment or be unexported (golint)
    • Line 100: warning: exported function OptHandlerLogger should have comment or be unexported (golint)
    • Line 107: warning: exported function OptHandlerListener should have comment or be unexported (golint)
    • Line 152: warning: exported method Handler.Serve should have comment or be unexported (golint)
    • Line 1602: warning: exported function GetHTTPClient should have comment or be unexported (golint)
    • pilosa/http/client.go
    • Line 60: warning: exported function NewInternalClientFromURI should have comment or be unexported (golint)
    • Line 135: warning: exported method InternalClient.PostSchema should have comment or be unexported (golint)
    • Line 412: warning: exported method InternalClient.EnsureIndex should have comment or be unexported (golint)
    • Line 423: warning: exported method InternalClient.EnsureField should have comment or be unexported (golint)
    • Line 429: warning: exported method InternalClient.EnsureFieldWithOptions should have comment or be unexported (golint)
    • Line 778: warning: exported method InternalClient.CreateField should have comment or be unexported (golint)
    • Line 784: warning: comment on exported method InternalClient.CreateFieldWithOptions should be of the form "CreateFieldWithOptions ..." (golint)
    • pilosa/row.go
    • Line 60: warning: exported method Row.Freeze should have comment or be unexported (golint)
    • pilosa/test/holder.go
    • Line 109: warning: exported method Holder.RowAttrStore should have comment or be unexported (golint)
    • Line 118: warning: exported method Holder.RowTime should have comment or be unexported (golint)
    • pilosa/version.go
    • Line 17: warning: exported var Enterprise should have comment or be unexported (golint)
    • Line 18: warning: exported var EnterpriseEnabled should have comment or be unexported (golint)
    • Line 19: warning: exported var Version should have comment or be unexported (golint)
    • Line 20: warning: exported var BuildTime should have comment or be unexported (golint)
    • pilosa/logger/logger.go
    • Line 48: warning: exported function NewStandardLogger should have comment or be unexported (golint)
    • Line 69: warning: exported function NewVerboseLogger should have comment or be unexported (golint)
    • pilosa/mock/translator.go
    • Line 25: warning: exported type TranslateStore should have comment or be unexported (golint)
    • Line 38: warning: exported method TranslateStore.Close should have comment or be unexported (golint)
    • Line 42: warning: exported method TranslateStore.MaxID should have comment or be unexported (golint)
    • Line 46: warning: exported method TranslateStore.ReadOnly should have comment or be unexported (golint)
    • Line 50: warning: exported method TranslateStore.SetReadOnly should have comment or be unexported (golint)
    • Line 54: warning: exported method TranslateStore.TranslateKey should have comment or be unexported (golint)
    • Line 58: warning: exported method TranslateStore.TranslateKeys should have comment or be unexported (golint)
    • Line 62: warning: exported method TranslateStore.TranslateID should have comment or be unexported (golint)
    • Line 66: warning: exported method TranslateStore.TranslateIDs should have comment or be unexported (golint)
    • Line 70: warning: exported method TranslateStore.ForceSet should have comment or be unexported (golint)
    • Line 74: warning: exported method TranslateStore.EntryReader should have comment or be unexported (golint)
    • Line 80: warning: exported type TranslateEntryReader should have comment or be unexported (golint)
    • Line 85: warning: exported method TranslateEntryReader.Close should have comment or be unexported (golint)
    • Line 89: warning: exported method TranslateEntryReader.ReadEntry should have comment or be unexported (golint)
    • pilosa/pql/token.go
    • Line 21: warning: comment on exported const ILLEGAL should be of the form "ILLEGAL ..." (golint)
    • Line 24: warning: exported const ASSIGN should have comment (or a comment on this block) or be unexported (golint)
    • pilosa/test/pilosa.go
    • Line 38: warning: comment on exported type Command should be of the form "Command ..." (with optional leading article) (golint)
    • Line 46: warning: exported function OptAllowedOrigins should have comment or be unexported (golint)
    • Line 190: warning: exported method Command.QueryProtobuf should have comment or be unexported (golint)
    • Line 255: warning: exported method Cluster.ImportBits should have comment or be unexported (golint)
    • Line 332: warning: comment on exported method Cluster.Close should be of the form "Close ..." (golint)
    • Line 428: warning: exported function CheckGroupBy should have comment or be unexported (golint)
    • pilosa/ctl/export.go
    • Line 106: warning: exported method ExportCommand.TLSHost should have comment or be unexported (golint)
    • Line 110: warning: exported method ExportCommand.TLSConfiguration should have comment or be unexported (golint)
    • pilosa/ctl/import.go
    • Line 393: warning: exported method ImportCommand.TLSHost should have comment or be unexported (golint)
    • Line 397: warning: exported method ImportCommand.TLSConfiguration should have comment or be unexported (golint)
    • pilosa/roaring/roaring.go
    • Line 80: warning: exported type Containers should have comment or be unexported (golint)
    • Line 139: warning: exported type ContainerIterator should have comment or be unexported (golint)
    • Line 1282: warning: receiver name r should be consistent with previous receiver name b for baseRoaringIterator (golint)
    • Line 1293: warning: receiver name r should be consistent with previous receiver name b for baseRoaringIterator (golint)
    • Line 1424: warning: receiver name r should be consistent with previous receiver name b for baseRoaringIterator (golint)
    • Line 1607: warning: exported method Bitmap.PreferMapping should have comment or be unexported (golint)
    • Line 5193: warning: comment on exported method Bitmap.BitwiseEqual should be of the form "BitwiseEqual ..." (golint)
    • pilosa/gossip/gossip.go
    • Line 255: 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)
    • pilosa/cmd.go
    • Line 41: warning: exported method CmdIO.Logger should have comment or be unexported (golint)
    • pilosa/translate.go
    • Line 224: warning: exported method InMemTranslateStore.Close should have comment or be unexported (golint)
    • Line 242: warning: comment on exported method InMemTranslateStore.TranslateKey should be of the form "TranslateKey ..." (golint)
    • pilosa/syswrap/mmap.go
    • Line 29: warning: exported var ErrMaxMapCountReached should have comment or be unexported (golint)
    • Line 37: warning: exported function SetMaxMapCount should have comment or be unexported (golint)
    • pilosa/boltdb/translate.go
    • Line 1: warning: package comment should be of the form "Package boltdb ..." (golint)
    • Line 138: warning: comment on exported method TranslateStore.TranslateKey should be of the form "TranslateKey ..." (golint)
    • Line 289: warning: comment on exported method TranslateStore.EntryReader should be of the form "EntryReader ..." (golint)
    • Line 324: warning: exported type TranslateEntryReader should have comment or be unexported (golint)
    • pilosa/pql/pql.peg.go
    • Line 316: warning: exported type PQL should have comment or be unexported (golint)
    • Line 328: warning: exported method PQL.Parse should have comment or be unexported (golint)
    • Line 332: warning: exported method PQL.Reset should have comment or be unexported (golint)
    • Line 396: warning: exported method PQL.PrintSyntaxTree should have comment or be unexported (golint)
    • Line 404: warning: exported method PQL.Execute should have comment or be unexported (golint)
    • Line 536: warning: exported method PQL.Init should have comment or be unexported (golint)
    • pilosa/server/server.go
    • Line 91: warning: exported type CommandOption should have comment or be unexported (golint)
    • Line 93: warning: exported function OptCommandServerOptions should have comment or be unexported (golint)
    • Line 100: warning: exported function OptCommandCloseTimeout should have comment or be unexported (golint)
    • Line 107: warning: exported function OptCommandConfig should have comment or be unexported (golint)
    • Line 171: warning: exported method Command.UpAndDown should have comment or be unexported (golint)
    • pilosa/api.go
    • Line 57: warning: exported function OptAPIServer should have comment or be unexported (golint)
    • Line 67: warning: exported function OptAPIImportWorkerPoolSize should have comment or be unexported (golint)
    • pilosa/mock/mock.go
    • Line 19: warning: exported type ReadCloser should have comment or be unexported (golint)
    • Line 29: warning: exported method ReadCloser.Close should have comment or be unexported (golint)
    • pilosa/internal/test/querygenerator.go
    • Line 25: warning: exported type Args should have comment or be unexported (golint)
    • Line 27: warning: exported type Calls should have comment or be unexported (golint)
    • Line 29: warning: exported function PQL should have comment or be unexported (golint)
    • Line 33: warning: exported function Row should have comment or be unexported (golint)
    • Line 66: warning: exported function Set should have comment or be unexported (golint)
    • Line 70: warning: exported function Clear should have comment or be unexported (golint)
    • Line 93: warning: exported function Count should have comment or be unexported (golint)
    • Line 98: warning: exported function Union should have comment or be unexported (golint)
    • Line 103: warning: exported function Intersect should have comment or be unexported (golint)
    • Line 108: warning: exported function Difference should have comment or be unexported (golint)
    • Line 113: warning: exported function Xor should have comment or be unexported (golint)
    • Line 118: warning: exported function Not should have comment or be unexported (golint)
    • Line 123: warning: exported function Between should have comment or be unexported (golint)
    • Line 132: warning: exported function Lt should have comment or be unexported (golint)
    • Line 141: warning: exported function Lte should have comment or be unexported (golint)
    • Line 150: warning: exported function Gt should have comment or be unexported (golint)
    • Line 160: warning: exported function Gte should have comment or be unexported (golint)
    • Line 169: warning: exported function CompareCall should have comment or be unexported (golint)
    • Line 202: warning: exported function Compare should have comment or be unexported (golint)
    • pilosa/test/cluster.go
    • Line 17: warning: comment on exported type ModHasher should be of the form "ModHasher ..." (with optional leading article) (golint)
    • Line 20: warning: exported method ModHasher.Hash should have comment or be unexported (golint)
    • pilosa/server/tlsconfig.go
    • Line 68: warning: exported function NewKeypairReloader should have comment or be unexported (golint)
    • Line 118: warning: exported function GetTLSConfig should have comment or be unexported (golint)
    • pilosa/cluster.go
    • Line 46: warning: comment on exported const ClusterStateStarting should be of the form "ClusterStateStarting ..." (golint)
    • Line 48: warning: exported const ClusterStateDegraded should have comment (or a comment on this block) or be unexported (golint)
    • Line 78: warning: exported method Node.Clone should have comment or be unexported (golint)
    • pilosa/server.go
    • Line 189: warning: exported function OptServerExecutorPoolSize should have comment or be unexported (golint)
    • Line 388: warning: exported method Server.InternalClient should have comment or be unexported (golint)

gocyclo82%

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.

    • pilosa/roaring/roaring.go
    • Line 5041: warning: cyclomatic complexity 27 of function xorCompare() is high (> 15) (gocyclo)
    • Line 3943: warning: cyclomatic complexity 22 of function unionInterval16InPlace() is high (> 15) (gocyclo)
    • Line 4973: warning: cyclomatic complexity 22 of function xorArrayRun() is high (> 15) (gocyclo)
    • Line 739: warning: cyclomatic complexity 21 of function (*Bitmap).unionInPlace() is high (> 15) (gocyclo)
    • Line 3814: warning: cyclomatic complexity 19 of function (*Container).equals() is high (> 15) (gocyclo)
    • Line 1819: warning: cyclomatic complexity 19 of function (*Iterator).Next() is high (> 15) (gocyclo)
    • Line 2392: warning: cyclomatic complexity 18 of function (*Container).unionInPlace() is high (> 15) (gocyclo)
    • Line 4290: warning: cyclomatic complexity 18 of function differenceRunBitmap() is high (> 15) (gocyclo)
    • Line 1511: warning: cyclomatic complexity 17 of function (*Bitmap).ImportRoaringBits() is high (> 15) (gocyclo)
    • Line 3383: warning: cyclomatic complexity 17 of function intersectBitmapRun() is high (> 15) (gocyclo)
    • Line 3339: warning: cyclomatic complexity 16 of function intersectRunRun() is high (> 15) (gocyclo)
    • pilosa/fragment.go
    • Line 1570: warning: cyclomatic complexity 32 of function (*fragment).top() is high (> 15) (gocyclo)
    • Line 1875: warning: cyclomatic complexity 24 of function (*fragment).mergeBlock() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 24 of function (*fragment).openStorage() is high (> 15) (gocyclo)
    • Line 1044: warning: cyclomatic complexity 22 of function (*fragment).importSetValue() is high (> 15) (gocyclo)
    • Line 977: warning: cyclomatic complexity 21 of function (*fragment).setValueBase() is high (> 15) (gocyclo)
    • Line 2861: warning: cyclomatic complexity 18 of function (*fragmentSyncer).syncFragment() is high (> 15) (gocyclo)
    • pilosa/holder_internal_test.go
    • Line 96: warning: cyclomatic complexity 27 of function TestHolder_Optn() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 22 of function TestHolderCleaner_CleanHolder() is high (> 15) (gocyclo)
    • pilosa/http/client_test.go
    • Line 520: warning: cyclomatic complexity 29 of function TestClient_ImportKeys() is high (> 15) (gocyclo)
    • Line 847: warning: cyclomatic complexity 27 of function TestClient_ImportValue() is high (> 15) (gocyclo)
    • Line 398: warning: cyclomatic complexity 26 of function TestClient_ImportRoaring() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 21 of function TestClient_Export() is high (> 15) (gocyclo)
    • Line 37: warning: cyclomatic complexity 20 of function TestClient_MultiNode() is high (> 15) (gocyclo)
    • pilosa/executor.go
    • Line 1533: warning: cyclomatic complexity 33 of function (*executor).executeRowBSIGroupShard() is high (> 15) (gocyclo)
    • Line 2799: warning: cyclomatic complexity 31 of function (*executor).translateResult() is high (> 15) (gocyclo)
    • Line 1319: warning: cyclomatic complexity 30 of function (*executor).executeRowsShard() is high (> 15) (gocyclo)
    • Line 2627: warning: cyclomatic complexity 25 of function (*executor).translateCall() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 22 of function (*executor).Execute() is high (> 15) (gocyclo)
    • Line 1068: warning: cyclomatic complexity 21 of function (*executor).executeGroupBy() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 21 of function (*executor).executeCall() is high (> 15) (gocyclo)
    • Line 1441: warning: cyclomatic complexity 21 of function (*executor).executeRowShard() is high (> 15) (gocyclo)
    • Line 3088: warning: cyclomatic complexity 20 of function newGroupByIterator() is high (> 15) (gocyclo)
    • Line 2272: warning: cyclomatic complexity 18 of function (*executor).executeBulkSetRowAttrs() is high (> 15) (gocyclo)
    • Line 2721: warning: cyclomatic complexity 17 of function (*executor).translateGroupByCall() is high (> 15) (gocyclo)
    • pilosa/field.go
    • Line 1204: warning: cyclomatic complexity 17 of function (*Field).Import() is high (> 15) (gocyclo)
    • Line 1285: warning: cyclomatic complexity 17 of function (*Field).importValue() is high (> 15) (gocyclo)
    • pilosa/executor_test.go
    • Line 943: warning: cyclomatic complexity 44 of function TestExecutor_Execute_TopN() is high (> 15) (gocyclo)
    • Line 2025: warning: cyclomatic complexity 39 of function TestExecutor_Execute_Row_BSIGroup() is high (> 15) (gocyclo)
    • Line 2219: warning: cyclomatic complexity 37 of function TestExecutor_Execute_Range_BSIGroup_Deprecated() is high (> 15) (gocyclo)
    • Line 3112: warning: cyclomatic complexity 30 of function TestExecutor_Execute_SetRow() is high (> 15) (gocyclo)
    • Line 2888: warning: cyclomatic complexity 28 of function TestExecutor_Execute_ClearRow() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 26 of function TestExecutor_Execute_Set() is high (> 15) (gocyclo)
    • Line 2385: warning: cyclomatic complexity 22 of function TestExecutor_Execute_Remote_Row() is high (> 15) (gocyclo)
    • Line 1310: warning: cyclomatic complexity 21 of function TestExecutor_Execute_MinMax() is high (> 15) (gocyclo)
    • Line 1564: warning: cyclomatic complexity 21 of function TestExecutor_Execute_Sum() is high (> 15) (gocyclo)
    • Line 2640: warning: cyclomatic complexity 18 of function TestExecutor_ExecuteOptions() is high (> 15) (gocyclo)
    • Line 813: warning: cyclomatic complexity 18 of function TestExecutor_Execute_SetValue() is high (> 15) (gocyclo)
    • Line 4052: warning: cyclomatic complexity 18 of function TestExecutor_Execute_Shift() is high (> 15) (gocyclo)
    • pilosa/time.go
    • Line 104: warning: cyclomatic complexity 22 of function viewsByTimeRange() is high (> 15) (gocyclo)
    • pilosa/encoding/proto/proto.go
    • Line 42: warning: cyclomatic complexity 58 of function (Serializer).Unmarshal() is high (> 15) (gocyclo)
    • Line 273: warning: cyclomatic complexity 29 of function encodeToProto() is high (> 15) (gocyclo)
    • pilosa/api.go
    • Line 920: warning: cyclomatic complexity 23 of function (*API).Import() is high (> 15) (gocyclo)
    • pilosa/fragment_internal_test.go
    • Line 502: warning: cyclomatic complexity 55 of function TestFragment_Range() is high (> 15) (gocyclo)
    • Line 222: warning: cyclomatic complexity 35 of function TestFragment_SetValue() is high (> 15) (gocyclo)
    • Line 2915: warning: cyclomatic complexity 29 of function TestFragmentRowIterator() is high (> 15) (gocyclo)
    • Line 3181: warning: cyclomatic complexity 22 of function TestImportClearRestart() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 17 of function TestFragment_MinMax() is high (> 15) (gocyclo)
    • Line 2634: warning: cyclomatic complexity 16 of function TestFragment_RowsIteration() is high (> 15) (gocyclo)
    • pilosa/ctl/import.go
    • Line 82: warning: cyclomatic complexity 18 of function (*ImportCommand).Run() is high (> 15) (gocyclo)
    • Line 173: warning: cyclomatic complexity 17 of function (*ImportCommand).bufferBits() is high (> 15) (gocyclo)
    • pilosa/http/handler.go
    • Line 845: warning: cyclomatic complexity 32 of function (*fieldOptions).validate() is high (> 15) (gocyclo)
    • Line 1077: warning: cyclomatic complexity 19 of function (*Handler).handlePostImport() is high (> 15) (gocyclo)
    • Line 756: warning: cyclomatic complexity 17 of function (*Handler).handlePostField() is high (> 15) (gocyclo)
    • pilosa/holder_test.go
    • Line 31: warning: cyclomatic complexity 56 of function TestHolder_Open() is high (> 15) (gocyclo)
    • Line 302: warning: cyclomatic complexity 17 of function TestHolderSyncer_SyncHolder() is high (> 15) (gocyclo)
    • pilosa/broadcast.go
    • Line 85: warning: cyclomatic complexity 18 of function getMessage() is high (> 15) (gocyclo)
    • Line 124: warning: cyclomatic complexity 18 of function getMessageType() is high (> 15) (gocyclo)
    • pilosa/server/server_test.go
    • Line 130: warning: cyclomatic complexity 25 of function TestMain_SetRowAttrs() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 19 of function TestMain_Set_Quick() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 18 of function TestClusteringNodesReplica2() is high (> 15) (gocyclo)
    • pilosa/pql/pql.peg.go
    • Line 536: warning: cyclomatic complexity 396 of function (*PQL).Init() is high (> 15) (gocyclo)
    • Line 404: warning: cyclomatic complexity 61 of function (*PQL).Execute() is high (> 15) (gocyclo)
    • pilosa/server/cluster_test.go
    • Line 141: warning: cyclomatic complexity 35 of function TestClusterResize_AddNode() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 34 of function TestClusterResize_AddNodeConcurrentIndex() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 17 of function TestMain_SendReceiveMessage() is high (> 15) (gocyclo)
    • Line 554: warning: cyclomatic complexity 16 of function TestClusterResize_RemoveNode() is high (> 15) (gocyclo)
    • pilosa/roaring/roaring_internal_test.go
    • Line 2416: warning: cyclomatic complexity 45 of function TestIteratorRuns() is high (> 15) (gocyclo)
    • Line 2328: warning: cyclomatic complexity 33 of function TestIteratorBitmap() is high (> 15) (gocyclo)
    • Line 2256: warning: cyclomatic complexity 28 of function TestIteratorArray() is high (> 15) (gocyclo)
    • Line 2966: warning: cyclomatic complexity 25 of function TestContainerCombinations() is high (> 15) (gocyclo)
    • Line 130: warning: cyclomatic complexity 16 of function TestRunCountRange() is high (> 15) (gocyclo)
    • pilosa/roaring/btree_test.go
    • Line 606: warning: cyclomatic complexity 20 of function TestBtreeDelete0() is high (> 15) (gocyclo)
    • Line 67: warning: cyclomatic complexity 18 of function (*tree).dump() is high (> 15) (gocyclo)
    • Line 1326: warning: cyclomatic complexity 18 of function TestBtreePut() is high (> 15) (gocyclo)
    • pilosa/server.go
    • Line 569: warning: cyclomatic complexity 35 of function (*Server).receiveMessage() is high (> 15) (gocyclo)
    • pilosa/cluster.go
    • Line 1796: warning: cyclomatic complexity 17 of function (*cluster).nodeJoin() is high (> 15) (gocyclo)
    • Line 1297: warning: cyclomatic complexity 17 of function (*cluster).followResizeInstruction() is high (> 15) (gocyclo)

ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words