Preparing report...

Report for github.com/Avalanche-io/c4

A    Great!    Found 42 issues across 59 files

Tweet

gofmt91%

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!


gocyclo86%

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.

    • c4/db/db_test.go
    • Line 236: warning: cyclomatic complexity 35 of function TestLinkApi() is high (> 15) (gocyclo)
    • Line 41: warning: cyclomatic complexity 35 of function TestKeyApi() is high (> 15) (gocyclo)

golint40%

Golint is a linter for Go source code.

    • c4/doc.go
    • Line 1: warning: package comment should be of the form "Package c4 ..." (golint)
    • c4/tree.go
    • Line 11: warning: comment on exported type Tree should be of the form "Tree ..." (with optional leading article) (golint)
    • Line 33: warning: exported function ReadTree should have comment or be unexported (golint)
    • Line 124: warning: comment on exported method Tree.Len should be of the form "Len ..." (golint)
    • Line 129: warning: comment on exported method Tree.ID should be of the form "ID ..." (golint)
    • c4/id/identify.go
    • Line 7: warning: comment on exported function Identify should be of the form "Identify ..." (golint)
    • c4/id/encoding.go
    • Line 8: warning: exported method ID.MarshalBinary should have comment or be unexported (golint)
    • Line 15: warning: exported method ID.UnmarshalBinary should have comment or be unexported (golint)
    • Line 24: warning: exported method ID.MarshalText should have comment or be unexported (golint)
    • Line 31: warning: exported method ID.UnmarshalText should have comment or be unexported (golint)
    • Line 40: warning: exported method Tree.MarshalBinary should have comment or be unexported (golint)
    • Line 52: warning: exported method Tree.UnmarshalBinary should have comment or be unexported (golint)
    • Line 80: warning: exported method Tree.MarshalText should have comment or be unexported (golint)
    • c4/id/id.go
    • Line 47: warning: comment on exported method ID.Cmp should be of the form "Cmp ..." (golint)
    • Line 56: warning: receiver name l should be consistent with previous receiver name id for ID (golint)
    • Line 108: warning: comment on exported method ID.Less should be of the form "Less ..." (golint)
    • c4/id/marshal.go
    • Line 10: warning: comment on exported method ID.GobDecode should be of the form "GobDecode ..." (golint)
    • c4/id/slice.go
    • Line 5: warning: exported type Slice should have comment or be unexported (golint)
    • Line 49: warning: comment on exported method Slice.ID should be of the form "ID ..." (golint)
    • c4/cmd/c4/flags.go
    • Line 11: warning: don't use underscores in Go names; var recursive_flag should be recursiveFlag (golint)
    • Line 12: warning: don't use underscores in Go names; var version_flag should be versionFlag (golint)
    • Line 13: warning: don't use underscores in Go names; var arg_links should be argLinks (golint)
    • Line 14: warning: don't use underscores in Go names; var links_flag should be linksFlag (golint)
    • Line 15: warning: don't use underscores in Go names; var no_links should be noLinks (golint)
    • Line 18: warning: don't use underscores in Go names; var include_meta should be includeMeta (golint)
    • Line 19: warning: don't use underscores in Go names; var absolute_flag should be absoluteFlag (golint)
    • Line 20: warning: don't use underscores in Go names; var formatting_string should be formattingString (golint)
    • c4/cmd/c4/output.go
    • Line 8: warning: don't use underscores in Go names; func metadata_output should be metadataOutput (golint)
    • c4/id/digest.go
    • Line 58: warning: receiver name d should be consistent with previous receiver name l for Digest (golint)
    • Line 67: warning: receiver name d should be consistent with previous receiver name l for Digest (golint)
    • Line 80: warning: receiver name d should be consistent with previous receiver name l for Digest (golint)
    • c4/manifest/filemode.go
    • Line 9: warning: exported function ParseFileMode should have comment or be unexported (golint)
    • Line 76: warning: exported const OS_READ should have comment (or a comment on this block) or be unexported (golint)
    • c4/id/tree.go
    • Line 18: warning: exported type Tree should have comment or be unexported (golint)
    • Line 27: warning: don't use underscores in Go names; var last_row should be lastRow (golint)
    • Line 37: warning: exported method Tree.IDcount should have comment or be unexported (golint)
    • Line 41: warning: exported method Tree.NodeCount should have comment or be unexported (golint)
    • Line 45: warning: exported method Tree.RowCount should have comment or be unexported (golint)
    • Line 49: warning: exported method Tree.Row should have comment or be unexported (golint)
    • Line 115: warning: don't use underscores in Go names; var last_row should be lastRow (golint)
    • Line 119: warning: exported method Tree.ID should have comment or be unexported (golint)
    • Line 123: warning: exported method Tree.Digest should have comment or be unexported (golint)
    • Line 127: warning: comment on exported type Node should be of the form "Node ..." (with optional leading article) (golint)
    • Line 165: warning: exported method Tree.Node should have comment or be unexported (golint)
    • Line 172: warning: exported method Node.Parent should have comment or be unexported (golint)
    • Line 185: warning: exported method Node.Label should have comment or be unexported (golint)
    • Line 190: warning: exported method Node.Left should have comment or be unexported (golint)
    • Line 199: warning: exported method Node.Right should have comment or be unexported (golint)
    • c4/util/charset.go
    • Line 30: warning: exported const OldCharset should have comment (or a comment on this block) or be unexported (golint)
    • Line 68: warning: comment on exported function CheckCharacterSet should be of the form "CheckCharacterSet ..." (golint)
    • Line 77: warning: don't use underscores in Go names; var remove_set should be removeSet (golint)
    • Line 115: warning: don't use underscores in Go names; var id_str should be idStr (golint)
    • Line 132: warning: don't use underscores in Go names; var id_str should be idStr (golint)
    • c4/id/doc.go
    • Line 1: warning: package comment should be of the form "Package id ..." (golint)
    • c4/id/common_ids.go
    • Line 8: warning: comment on exported var NIL_ID should be of the form "NIL_ID ..." (golint)
    • Line 11: warning: comment on exported var VOID_ID should be of the form "VOID_ID ..." (golint)
    • Line 14: warning: exported var MAX_ID should have comment or be unexported (golint)
    • c4/cmd/c4/main.go
    • Line 13: warning: don't use underscores in Go names; const version_number should be versionNumber (golint)
    • Line 21: warning: don't use underscores in Go names; var file_list should be fileList (golint)
    • Line 37: warning: don't use underscores in Go names; func identify_pipe should be identifyPipe (golint)
    • Line 47: warning: don't use underscores in Go names; func identify_file should be identifyFile (golint)
    • Line 57: warning: don't use underscores in Go names; func identify_files should be identifyFiles (golint)
    • Line 57: warning: don't use underscores in Go names; func parameter file_list should be fileList (golint)
    • c4/cmd/c4/walker.go
    • Line 33: warning: don't use underscores in Go names; func parameter relative_path should be relativePath (golint)
    • c4/manifest/db.go
    • Line 7: warning: exported type MDB should have comment or be unexported (golint)
    • Line 14: warning: exported function NewDb should have comment or be unexported (golint)
    • c4/manifest/manifest.go
    • Line 20: warning: exported type FileInfo should have comment or be unexported (golint)
    • Line 31: warning: exported method FileInfo.Name should have comment or be unexported (golint)
    • Line 35: warning: exported method FileInfo.Size should have comment or be unexported (golint)
    • Line 39: warning: exported method FileInfo.Mode should have comment or be unexported (golint)
    • Line 43: warning: exported method FileInfo.ModTime should have comment or be unexported (golint)
    • Line 47: warning: exported method FileInfo.IsDir should have comment or be unexported (golint)
    • Line 51: warning: exported method FileInfo.Sys should have comment or be unexported (golint)
    • Line 55: warning: exported method FileInfo.ID should have comment or be unexported (golint)
    • Line 59: warning: exported method FileInfo.Metadata should have comment or be unexported (golint)
    • Line 63: warning: exported method FileInfo.MkString should have comment or be unexported (golint)
    • Line 67: warning: exported method FileInfo.MarshalJson should have comment or be unexported (golint)
    • Line 92: warning: exported method FileInfo.UnmarshalJson should have comment or be unexported (golint)
    • Line 137: warning: exported function ParseFileInfo should have comment or be unexported (golint)
    • Line 225: warning: exported function MakeFileInfo should have comment or be unexported (golint)
    • Line 236: warning: exported function NewFileInfo should have comment or be unexported (golint)
    • Line 356: warning: comment on exported type M should be of the form "M ..." (with optional leading article) (golint)
    • Line 359: warning: exported function NewManifest should have comment or be unexported (golint)
    • Line 363: warning: exported method M.Len should have comment or be unexported (golint)
    • Line 368: warning: exported method M.SetFileInfo should have comment or be unexported (golint)
    • Line 380: warning: exported method M.SetId should have comment or be unexported (golint)
    • Line 391: warning: exported method M.SetMetadata should have comment or be unexported (golint)
    • Line 404: warning: comment on exported method M.Get should be of the form "Get ..." (golint)
    • Line 412: warning: exported method M.Paths should have comment or be unexported (golint)
    • Line 424: warning: exported method M.Marshal should have comment or be unexported (golint)
    • Line 472: warning: exported method M.Unmarshal should have comment or be unexported (golint)
    • c4/store/logger.go
    • Line 12: warning: exported type LoggerFlags should have comment or be unexported (golint)
    • Line 15: warning: exported const LogOpen should have comment (or a comment on this block) or be unexported (golint)
    • c4/store/map.go
    • Line 16: warning: exported function NewMap should have comment or be unexported (golint)
    • Line 39: warning: exported method MAP.Delete should have comment or be unexported (golint)
    • Line 39: warning: receiver name m should be consistent with previous receiver name s for MAP (golint)
    • Line 43: warning: exported method MAP.Load should have comment or be unexported (golint)
    • Line 43: warning: receiver name m should be consistent with previous receiver name s for MAP (golint)
    • Line 47: warning: exported method MAP.LoadOrStore should have comment or be unexported (golint)
    • Line 47: warning: receiver name m should be consistent with previous receiver name s for MAP (golint)
    • Line 57: warning: exported method MAP.Range should have comment or be unexported (golint)
    • Line 57: warning: receiver name m should be consistent with previous receiver name s for MAP (golint)
    • c4/store/validating.go
    • Line 24: warning: exported function NewValidating should have comment or be unexported (golint)
    • Line 28: warning: exported var ErrInvalidID should have comment or be unexported (golint)
    • Line 125: warning: exported method Validating.Remove should have comment or be unexported (golint)
    • c4/id/encoder.go
    • Line 15: warning: comment on exported function NewEncoder should be of the form "NewEncoder ..." (golint)
    • c4/internals_test.go
    • Line 51: warning: don't use underscores in Go names; var expected_digests should be expectedDigests (golint)
    • Line 81: warning: don't use underscores in Go names; var test_vectors should be testVectors (golint)
    • Line 82: warning: don't use underscores in Go names; var test_vector_ids should be testVectorIds (golint)
    • c4/id/tree_utils.go
    • Line 6: warning: don't use underscores in Go names; func result row_count should be rowCount (golint)
    • Line 6: warning: don't use underscores in Go names; func result tree_size should be treeSize (golint)
    • Line 11: warning: don't use underscores in Go names; var tree_size should be treeSize (golint)
    • Line 17: warning: don't use underscores in Go names; type row_index should be rowIndex (golint)
    • Line 49: warning: don't use underscores in Go names; var row_count should be rowCount (golint)
    • Line 49: warning: don't use underscores in Go names; var node_count should be nodeCount (golint)
    • c4/db/db.go
    • Line 31: warning: comment on exported type TreeStrategyType should be of the form "TreeStrategyType ..." (with optional leading article) (golint)
    • Line 37: warning: exported const TreeStrategyNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: comment on exported const TreeStrategyCache should be of the form "TreeStrategyCache ..." (golint)
    • Line 42: warning: comment on exported const TreeStrategyCompute should be of the form "TreeStrategyCompute ..." (golint)
    • Line 46: warning: comment on exported const TreeStrategyBalance should be of the form "TreeStrategyBalance ..." (golint)
    • Line 51: warning: exported type Options should have comment or be unexported (golint)
    • Line 76: warning: exported type Tx should have comment or be unexported (golint)
    • Line 84: warning: exported method Tx.KeySet should have comment or be unexported (golint)
    • Line 97: warning: exported method Tx.Err should have comment or be unexported (golint)
    • Line 154: warning: don't use underscores in Go names; var db_path should be dbPath (golint)
    • Line 179: warning: don't use underscores in Go names; var saved_options should be savedOptions (golint)
    • Line 206: warning: don't use underscores in Go names; method write_options should be writeOptions (golint)
    • Line 223: warning: don't use underscores in Go names; method read_options should be readOptions (golint)
    • Line 239: warning: exported method DB.Close should have comment or be unexported (golint)
    • Line 243: warning: exported type Stats should have comment or be unexported (golint)
    • Line 251: warning: exported method DB.Stats should have comment or be unexported (golint)
    • Line 329: warning: exported method DB.KeyFind should have comment or be unexported (golint)
    • Line 343: warning: exported method DB.KeyGet should have comment or be unexported (golint)
    • Line 359: warning: exported method DB.KeyDelete should have comment or be unexported (golint)
    • Line 437: warning: don't use underscores in Go names; var entry_pool should be entryPool (golint)
    • Line 443: warning: exported method DB.KeyGetAll should have comment or be unexported (golint)
    • Line 443: warning: don't use underscores in Go names; method parameter key_prefix should be keyPrefix (golint)
    • Line 456: warning: don't use underscores in Go names; range var key_prefix should be keyPrefix (golint)
    • Line 486: warning: don't use underscores in Go names; method parameter old_digest should be oldDigest (golint)
    • Line 486: warning: don't use underscores in Go names; method parameter new_digest should be newDigest (golint)
    • Line 509: warning: don't use underscores in Go names; method parameter key_prefixs should be keyPrefixs (golint)
    • Line 527: warning: don't use underscores in Go names; range var key_prefix should be keyPrefix (golint)
    • Line 579: warning: exported method DB.LinkGet should have comment or be unexported (golint)
    • Line 613: warning: exported method DB.LinkDelete should have comment or be unexported (golint)
    • Line 646: warning: exported method DB.LinkGetAll should have comment or be unexported (golint)
    • Line 700: warning: exported method DB.LinkDeleteAll should have comment or be unexported (golint)
    • Line 743: warning: exported method DB.TreeSet should have comment or be unexported (golint)
    • Line 772: warning: exported method DB.TreeGet should have comment or be unexported (golint)
    • Line 772: warning: don't use underscores in Go names; method parameter tree_digest should be treeDigest (golint)
    • Line 783: warning: don't use underscores in Go names; var path_data should be pathData (golint)
    • Line 804: warning: exported method DB.TreeDelete should have comment or be unexported (golint)
    • Line 811: warning: exported method DB.KeyBatch should have comment or be unexported (golint)
    • Line 875: warning: don't use underscores in Go names; func write_file_data should be writeFileData (golint)
    • Line 878: warning: don't use underscores in Go names; var save_paths should be savePaths (golint)
    • Line 926: warning: comment on exported method DB.Update should be of the form "Update ..." (golint)
    • Line 940: warning: comment on exported method DB.View should be of the form "View ..." (golint)
    • Line 951: warning: comment on exported method DB.Batch should be of the form "Batch ..." (golint)
    • c4/id.go
    • Line 72: warning: comment on exported function Identify should be of the form "Identify ..." (golint)
    • Line 83: warning: comment on exported type ID should be of the form "ID ..." (with optional leading article) (golint)
    • Line 122: warning: exported method ID.IsNil should have comment or be unexported (golint)
    • Line 185: warning: receiver name l should be consistent with previous receiver name id for ID (golint)
    • Line 217: warning: comment on exported method ID.Less should be of the form "Less ..." (golint)
    • Line 222: warning: exported method ID.Sum should have comment or be unexported (golint)
    • Line 222: warning: receiver name l should be consistent with previous receiver name id for ID (golint)
    • Line 240: warning: exported method ID.UnmarshalJSON should have comment or be unexported (golint)
    • Line 253: warning: exported method ID.MarshalJSON should have comment or be unexported (golint)
    • Line 260: warning: exported type IDs should have comment or be unexported (golint)
    • Line 266: warning: comment on exported method IDs.Tree should be of the form "Tree ..." (golint)
    • Line 278: warning: exported method IDs.ID should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell91%

Misspell Finds commonly misspelled English words