Preparing report...

Report for github.com/unit-io/tracedb

(v0.0.0-20200416200033-a72526b4e9b0)

A+    Excellent!    Found 12 issues across 61 files

Tweet

gofmt95%

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!


gocyclo91%

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.

    • db.go
    • Line 441: warning: cyclomatic complexity 36 of function (*DB).Get() is high (> 15) (gocyclo)
    • Line 110: warning: cyclomatic complexity 29 of function Open() is high (> 15) (gocyclo)
    • db_sync.go
    • Line 186: warning: cyclomatic complexity 22 of function (*syncHandle).Sync() is high (> 15) (gocyclo)
    • block.go
    • Line 229: warning: cyclomatic complexity 18 of function (*blockWriter).write() is high (> 15) (gocyclo)
    • db_test.go
    • Line 19: warning: cyclomatic complexity 17 of function TestSimple() is high (> 15) (gocyclo)
    • wal/wal_test.go
    • Line 69: warning: cyclomatic complexity 16 of function TestLogApplied() is high (> 15) (gocyclo)

golint88%

Golint is a linter for Go source code.

    • wal/wal.go
    • Line 34: warning: exported const DefaultBufferSize should have comment (or a comment on this block) or be unexported (golint)
    • uid/uid.go
    • Line 42: warning: exported function Time should have comment or be unexported (golint)
    • Line 46: warning: comment on exported function NewLID should be of the form "NewLID ..." (golint)
    • block.go
    • Line 109: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 330: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 334: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • db.go
    • Line 978: warning: exported method DB.Seq should have comment or be unexported (golint)
    • entry.go
    • Line 34: warning: exported method Entry.SetID should have comment or be unexported (golint)
    • Line 39: warning: exported method Entry.SetPayload should have comment or be unexported (golint)
    • Line 44: warning: exported method Entry.SetContract should have comment or be unexported (golint)
    • Line 49: warning: exported method Entry.SetTTL should have comment or be unexported (golint)
    • recovery.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • timewindow.go
    • Line 318: warning: should omit 2nd value from range; this loop is equivalent to `for h := range ...` (golint)
    • Line 455: warning: receiver name w should be consistent with previous receiver name b for winBlock (golint)
    • Line 457: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (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!