Preparing report...

Report for github.com/conprof/tsdb

A    Great!    Found 31 issues across 78 files

Tweet

gofmt70%

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!


golint88%

Golint is a linter for Go source code.

    • tsdb/index/index.go
    • Line 373: warning: exported method Writer.AddSymbols should have comment or be unexported (golint)
    • Line 404: warning: exported method Writer.WriteLabelIndex should have comment or be unexported (golint)
    • Line 487: warning: exported method Writer.WritePostings should have comment or be unexported (golint)
    • Line 550: warning: exported method Writer.Close should have comment or be unexported (golint)
    • Line 571: warning: exported type Reader should have comment or be unexported (golint)
    • Line 956: warning: exported function NewStringTuples should have comment or be unexported (golint)
    • tsdb/index/postings.go
    • Line 597: warning: exported function NewListPostings should have comment or be unexported (golint)
    • Line 605: warning: exported method ListPostings.At should have comment or be unexported (golint)
    • Line 609: warning: exported method ListPostings.Next should have comment or be unexported (golint)
    • Line 619: warning: exported method ListPostings.Seek should have comment or be unexported (golint)
    • Line 641: warning: exported method ListPostings.Err should have comment or be unexported (golint)
    • tsdb/tsdbutil/chunks.go
    • Line 21: warning: exported type Sample should have comment or be unexported (golint)
    • Line 26: warning: exported function ChunkFromSamples should have comment or be unexported (golint)
    • tsdb/fileutil/mmap.go
    • Line 22: warning: exported type MmapFile should have comment or be unexported (golint)
    • Line 27: warning: exported function OpenMmapFile should have comment or be unexported (golint)
    • Line 45: warning: exported method MmapFile.Close should have comment or be unexported (golint)
    • Line 55: warning: exported method MmapFile.File should have comment or be unexported (golint)
    • Line 59: warning: exported method MmapFile.Bytes should have comment or be unexported (golint)
    • tsdb/chunks/chunks.go
    • Line 41: warning: exported const ChunksFormatVersionSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 283: warning: exported method Writer.WriteChunks should have comment or be unexported (golint)
    • Line 338: warning: exported method Writer.Close should have comment or be unexported (golint)
    • Line 435: warning: exported method Reader.Close should have comment or be unexported (golint)
    • tsdb/wal/wal.go
    • Line 38: warning: exported const DefaultSegmentSize should have comment (or a comment on this block) or be unexported (golint)
    • tsdb/db.go
    • Line 40: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • tsdb/encoding/encoding.go
    • Line 26: warning: exported var ErrInvalidSize should have comment or be unexported (golint)
    • Line 36: warning: exported method Encbuf.Reset should have comment or be unexported (golint)
    • Line 37: warning: exported method Encbuf.Get should have comment or be unexported (golint)
    • Line 38: warning: exported method Encbuf.Len should have comment or be unexported (golint)
    • Line 40: warning: exported method Encbuf.PutString should have comment or be unexported (golint)
    • Line 41: warning: exported method Encbuf.PutByte should have comment or be unexported (golint)
    • Line 42: warning: exported method Encbuf.PutBytes should have comment or be unexported (golint)
    • Line 44: warning: exported method Encbuf.PutBE32int should have comment or be unexported (golint)
    • Line 45: warning: exported method Encbuf.PutUvarint32 should have comment or be unexported (golint)
    • Line 46: warning: exported method Encbuf.PutBE64int64 should have comment or be unexported (golint)
    • Line 47: warning: exported method Encbuf.PutUvarint should have comment or be unexported (golint)
    • Line 49: warning: exported method Encbuf.PutBE32 should have comment or be unexported (golint)
    • Line 54: warning: exported method Encbuf.PutBE64 should have comment or be unexported (golint)
    • Line 59: warning: exported method Encbuf.PutUvarint64 should have comment or be unexported (golint)
    • Line 64: warning: exported method Encbuf.PutVarint64 should have comment or be unexported (golint)
    • Line 155: warning: exported method Decbuf.Uvarint should have comment or be unexported (golint)
    • Line 156: warning: exported method Decbuf.Be32int should have comment or be unexported (golint)
    • Line 157: warning: exported method Decbuf.Be64int64 should have comment or be unexported (golint)
    • Line 164: warning: exported method Decbuf.UvarintStr should have comment or be unexported (golint)
    • Line 178: warning: exported method Decbuf.Varint64 should have comment or be unexported (golint)
    • Line 191: warning: exported method Decbuf.Uvarint64 should have comment or be unexported (golint)
    • Line 204: warning: exported method Decbuf.Be64 should have comment or be unexported (golint)
    • Line 217: warning: exported method Decbuf.Be32 should have comment or be unexported (golint)
    • Line 230: warning: exported method Decbuf.Byte should have comment or be unexported (golint)
    • Line 243: warning: exported method Decbuf.UvarintBytes should have comment or be unexported (golint)
    • Line 257: warning: exported method Decbuf.Err should have comment or be unexported (golint)
    • Line 258: warning: exported method Decbuf.Len should have comment or be unexported (golint)
    • Line 259: warning: exported method Decbuf.Get should have comment or be unexported (golint)

gocyclo84%

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.

    • tsdb/wal.go
    • Line 872: warning: cyclomatic complexity 28 of function (*walReader).Read() is high (> 15) (gocyclo)
    • Line 306: warning: cyclomatic complexity 22 of function (*SegmentWAL).Truncate() is high (> 15) (gocyclo)
    • Line 1235: warning: cyclomatic complexity 16 of function MigrateWAL() is high (> 15) (gocyclo)
    • tsdb/querier.go
    • Line 271: warning: cyclomatic complexity 18 of function PostingsForMatchers() is high (> 15) (gocyclo)
    • tsdb/compact.go
    • Line 652: warning: cyclomatic complexity 45 of function (*LeveledCompactor).populateBlock() is high (> 15) (gocyclo)
    • Line 530: warning: cyclomatic complexity 21 of function (*LeveledCompactor).write() is high (> 15) (gocyclo)
    • tsdb/repair.go
    • Line 32: warning: cyclomatic complexity 16 of function repairBadIndexVersion() is high (> 15) (gocyclo)
    • tsdb/wal/wal.go
    • Line 284: warning: cyclomatic complexity 18 of function (*WAL).Repair() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 16 of function (*WAL).log() is high (> 15) (gocyclo)
    • tsdb/head.go
    • Line 316: warning: cyclomatic complexity 28 of function (*Head).loadWAL() is high (> 15) (gocyclo)
    • Line 516: warning: cyclomatic complexity 16 of function (*Head).Truncate() is high (> 15) (gocyclo)
    • tsdb/db.go
    • Line 509: warning: cyclomatic complexity 18 of function (*DB).reload() is high (> 15) (gocyclo)
    • Line 411: warning: cyclomatic complexity 18 of function (*DB).compact() is high (> 15) (gocyclo)
    • Line 244: warning: cyclomatic complexity 17 of function Open() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words

    • tsdb/chunkenc/byte.go
    • Line 58: warning: "arround" is a misspelling of "around" (misspell)
    • Line 60: warning: "arround" is a misspelling of "around" (misspell)
    • Line 61: warning: "arround" is a misspelling of "around" (misspell)