Preparing report...

Report for github.com/dgraph-io/badger/v3

(v3.2103.5)

A+    Excellent!    Found 33 issues across 90 files

Tweet

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!


gofmt81%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

    • db.go
    • Line 1: warning: file is not gofmted with -s (gofmt)
    • txn.go
    • Line 1: warning: file is not gofmted with -s (gofmt)
    • doc.go
    • Line 1: warning: file is not gofmted with -s (gofmt)

gocyclo83%

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.

    • stream.go
    • Line 166: warning: cyclomatic complexity 22 of function (*Stream).produceKVs() is high (> 15) (gocyclo)
    • levels.go
    • Line 631: warning: cyclomatic complexity 36 of function (*levelsController).subcompact() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 20 of function (*levelsController).runCompactor() is high (> 15) (gocyclo)
    • Line 78: warning: cyclomatic complexity 16 of function newLevelsController() is high (> 15) (gocyclo)
    • db_test.go
    • Line 525: warning: cyclomatic complexity 22 of function TestGetMore() is high (> 15) (gocyclo)
    • iterator.go
    • Line 619: warning: cyclomatic complexity 17 of function (*Iterator).parseItem() is high (> 15) (gocyclo)
    • backup_test.go
    • Line 119: warning: cyclomatic complexity 16 of function TestBackupRestore2() is high (> 15) (gocyclo)
    • stream_writer.go
    • Line 86: warning: cyclomatic complexity 19 of function (*StreamWriter).Write() is high (> 15) (gocyclo)
    • db.go
    • Line 188: warning: cyclomatic complexity 32 of function Open() is high (> 15) (gocyclo)
    • Line 1376: warning: cyclomatic complexity 24 of function (*DB).Ranges() is high (> 15) (gocyclo)
    • Line 540: warning: cyclomatic complexity 21 of function (*DB).close() is high (> 15) (gocyclo)
    • value.go
    • Line 173: warning: cyclomatic complexity 24 of function (*valueLog).rewrite() is high (> 15) (gocyclo)
    • Line 790: warning: cyclomatic complexity 17 of function (*valueLog).write() is high (> 15) (gocyclo)
    • memtable.go
    • Line 451: warning: cyclomatic complexity 21 of function (*logFile).iterate() is high (> 15) (gocyclo)
    • y/watermark.go
    • Line 138: warning: cyclomatic complexity 21 of function (*WaterMark).process() is high (> 15) (gocyclo)
    • table/table.go
    • Line 537: warning: cyclomatic complexity 17 of function (*Table).block() is high (> 15) (gocyclo)
    • manifest.go
    • Line 348: warning: cyclomatic complexity 16 of function ReplayManifestFile() is high (> 15) (gocyclo)

ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • trie/trie.go
    • Line 71: warning: ineffectual assignment to start (ineffassign)
    • Line 71: warning: ineffectual assignment to start (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words