Preparing report...

Report for github.com/iden3/go-merkletree-sql

A+    Excellent!    Found 13 issues across 19 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo94%

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.


golint63%

Golint is a linter for Go source code.

    • go-merkletree-sql/elembytes.go
    • Line 18: warning: exported function NewElemBytesFromBigInt should have comment or be unexported (golint)
    • Line 24: warning: exported method ElemBytes.BigInt should have comment or be unexported (golint)
    • go-merkletree-sql/entry.go
    • Line 19: warning: exported type Entrier should have comment or be unexported (golint)
    • Line 23: warning: exported method Entry.Index should have comment or be unexported (golint)
    • Line 27: warning: exported method Entry.Value should have comment or be unexported (golint)
    • Line 72: warning: exported method Entry.Bytes should have comment or be unexported (golint)
    • Line 77: warning: exported method Entry.Equal should have comment or be unexported (golint)
    • Line 77: warning: receiver name e1 should be consistent with previous receiver name e for Entry (golint)
    • Line 81: warning: exported method Entry.MarshalText should have comment or be unexported (golint)
    • Line 85: warning: exported method Entry.UnmarshalText should have comment or be unexported (golint)
    • Line 89: warning: exported method Entry.Clone should have comment or be unexported (golint)
    • Line 94: warning: exported function CheckEntryInField should have comment or be unexported (golint)
    • go-merkletree-sql/db/sql/sql.go
    • Line 38: warning: exported type NodeItem should have comment or be unexported (golint)
    • Line 53: warning: exported type RootItem should have comment or be unexported (golint)
    • Line 319: warning: exported method NodeItem.Node should have comment or be unexported (golint)
    • go-merkletree-sql/db/test/test.go
    • Line 1: warning: package comment should be of the form "Package test ..." (golint)
    • Line 256: warning: exported function TestNewTree should have comment or be unexported (golint)
    • Line 286: warning: exported function TestAddDifferentOrder should have comment or be unexported (golint)
    • Line 311: warning: exported function TestAddRepeatedIndex should have comment or be unexported (golint)
    • Line 324: warning: exported function TestGet should have comment or be unexported (golint)
    • Line 352: warning: exported function TestUpdate should have comment or be unexported (golint)
    • Line 381: warning: exported function TestUpdate2 should have comment or be unexported (golint)
    • Line 411: warning: exported function TestGenerateAndVerifyProof128 should have comment or be unexported (golint)
    • Line 429: warning: exported function TestTreeLimit should have comment or be unexported (golint)
    • Line 445: warning: exported function TestSiblingsFromProof should have comment or be unexported (golint)
    • Line 485: warning: exported function TestVerifyProofCases should have comment or be unexported (golint)
    • Line 532: warning: exported function TestVerifyProofFalse should have comment or be unexported (golint)
    • Line 565: warning: exported function TestGraphViz should have comment or be unexported (golint)
    • Line 605: warning: exported function TestDelete should have comment or be unexported (golint)
    • Line 641: warning: exported function TestDelete2 should have comment or be unexported (golint)
    • Line 675: warning: exported function TestDelete3 should have comment or be unexported (golint)
    • Line 697: warning: exported function TestDelete4 should have comment or be unexported (golint)
    • Line 724: warning: exported function TestDelete5 should have comment or be unexported (golint)
    • Line 745: warning: exported function TestDeleteNonExistingKeys should have comment or be unexported (golint)
    • Line 768: warning: exported function TestDumpLeafsImportLeafs should have comment or be unexported (golint)
    • Line 799: warning: exported function TestAddAndGetCircomProof should have comment or be unexported (golint)
    • Line 842: warning: exported function TestUpdateCircomProcessorProof should have comment or be unexported (golint)
    • Line 872: warning: exported function TestSmtVerifier should have comment or be unexported (golint)
    • Line 916: warning: exported function TestTypesMarshalers should have comment or be unexported (golint)
    • go-merkletree-sql/data.go
    • Line 19: warning: exported method Data.Bytes should have comment or be unexported (golint)
    • Line 26: warning: exported method Data.Equal should have comment or be unexported (golint)
    • Line 26: warning: receiver name d1 should be consistent with previous receiver name d for Data (golint)
    • Line 31: warning: exported method Data.MarshalText should have comment or be unexported (golint)
    • Line 36: warning: exported method Data.UnmarshalText should have comment or be unexported (golint)
    • Line 46: warning: exported function NewDataFromBytes should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign68%

IneffAssign detects ineffectual assignments in Go code.

    • go-merkletree-sql/db/leveldb/leveldb.go
    • Line 37: warning: cannot use &(Storage literal) (value of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 42: warning: cannot use &(StorageTx literal) (value of type *StorageTx) as merkletree.Tx value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 82: warning: cannot use value (variable of type merkletree.Node) as []byte value in return statement (ineffassign)
    • Line 95: warning: cannot use v (variable of type []byte) as merkletree.Node value in argument to tx.cache.Put (ineffassign)
    • Line 101: warning: atx (variable of type merkletree.Tx) cannot have dynamic type *StorageTx (wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error))) (ineffassign)
    • Line 112: warning: cannot use v.V (variable of type merkletree.Node) as []byte value in argument to batch.Put (ineffassign)
    • Line 140: warning: cannot use merkletree.Clone(value) (value of type []byte) as merkletree.Node value in struct literal (ineffassign)
    • Line 37: warning: cannot use &(Storage literal) (value of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 42: warning: cannot use &(StorageTx literal) (value of type *StorageTx) as merkletree.Tx value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 82: warning: cannot use value (variable of type merkletree.Node) as []byte value in return statement (ineffassign)
    • Line 95: warning: cannot use v (variable of type []byte) as merkletree.Node value in argument to tx.cache.Put (ineffassign)
    • Line 101: warning: atx (variable of type merkletree.Tx) cannot have dynamic type *StorageTx (wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error))) (ineffassign)
    • Line 112: warning: cannot use v.V (variable of type merkletree.Node) as []byte value in argument to batch.Put (ineffassign)
    • Line 140: warning: cannot use merkletree.Clone(value) (value of type []byte) as merkletree.Node value in struct literal (ineffassign)
    • go-merkletree-sql/db/leveldb/leveldb_test.go
    • Line 27: warning: cannot use sto (variable of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 47: warning: cannot use sto (variable of type *Storage) as merkletree.Storage value in assignment: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • go-merkletree-sql/db/pebble/pebble.go
    • Line 34: warning: cannot use &(Storage literal) (value of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 39: warning: cannot use &(StorageTx literal) (value of type *StorageTx) as merkletree.Tx value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 127: warning: atx (variable of type merkletree.Tx) cannot have dynamic type *StorageTx (wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error))) (ineffassign)
    • Line 157: warning: cannot use merkletree.Clone(value) (value of type []byte) as merkletree.Node value in struct literal (ineffassign)
    • Line 34: warning: cannot use &(Storage literal) (value of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 39: warning: cannot use &(StorageTx literal) (value of type *StorageTx) as merkletree.Tx value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 127: warning: atx (variable of type merkletree.Tx) cannot have dynamic type *StorageTx (wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error))) (ineffassign)
    • Line 157: warning: cannot use merkletree.Clone(value) (value of type []byte) as merkletree.Node value in struct literal (ineffassign)
    • go-merkletree-sql/db/pebble/pebble_test.go
    • Line 27: warning: cannot use sto (variable of type *Storage) as merkletree.Storage value in return statement: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)
    • Line 47: warning: cannot use sto (variable of type *Storage) as merkletree.Storage value in assignment: wrong type for method Get (have func(key []byte) ([]byte, error), want func([]byte) (*github.com/iden3/go-merkletree-sql.Node, error)) (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!