Preparing report...

Report for github.com/berty/go-ipfs-log

A+    Excellent!    Found 30 issues across 48 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!


golint50%

Golint is a linter for Go source code.

    • go-ipfs-log/identityprovider/orbitdb.go
    • Line 12: warning: exported type OrbitDBIdentityProvider should have comment or be unexported (golint)
    • Line 81: warning: exported method OrbitDBIdentityProvider.UnmarshalPublicKey should have comment or be unexported (golint)
    • go-ipfs-log/iface/iface.go
    • Line 15: warning: exported const KeyEncryptedLinks should have comment or be unexported (golint)
    • Line 16: warning: exported const KeyEncryptedLinksNonce should have comment or be unexported (golint)
    • Line 18: warning: exported type WriteOpts should have comment or be unexported (golint)
    • Line 24: warning: exported type FetchOptions should have comment or be unexported (golint)
    • Line 34: warning: exported type IO should have comment or be unexported (golint)
    • Line 41: warning: exported type IOPreSign should have comment or be unexported (golint)
    • Line 46: warning: exported type LogOptions should have comment or be unexported (golint)
    • Line 57: warning: exported type CreateEntryOptions should have comment or be unexported (golint)
    • Line 62: warning: exported type JSONLog should have comment or be unexported (golint)
    • Line 67: warning: exported type IteratorOptions should have comment or be unexported (golint)
    • Line 75: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 82: warning: exported type AppendOptions should have comment or be unexported (golint)
    • Line 87: warning: exported type IPFSLog should have comment or be unexported (golint)
    • Line 104: warning: exported type EntrySortFn should have comment or be unexported (golint)
    • Line 106: warning: exported type IPFSLogOrderedEntries should have comment or be unexported (golint)
    • Line 146: warning: exported type IPFSLogEntry should have comment or be unexported (golint)
    • Line 181: warning: exported type IPFSLogLamportClock should have comment or be unexported (golint)
    • Line 196: warning: exported type Hashable should have comment or be unexported (golint)
    • go-ipfs-log/enc/box.go
    • Line 12: warning: exported const SecretBoxNonceSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var ErrInvalidKey should have comment or be unexported (golint)
    • Line 105: warning: exported function NewSecretbox should have comment or be unexported (golint)
    • go-ipfs-log/log.go
    • Line 24: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 25: warning: exported type JSONLog should have comment or be unexported (golint)
    • Line 26: warning: exported type LogOptions should have comment or be unexported (golint)
    • Line 27: warning: exported type IteratorOptions should have comment or be unexported (golint)
    • Line 28: warning: exported type IO should have comment or be unexported (golint)
    • Line 30: warning: exported type Entry should have comment or be unexported (golint)
    • Line 31: warning: exported type Log should have comment or be unexported (golint)
    • Line 32: warning: exported type AppendOptions should have comment or be unexported (golint)
    • Line 33: warning: exported type SortFn should have comment or be unexported (golint)
    • Line 35: warning: exported type IPFSLog should have comment or be unexported (golint)
    • Line 50: warning: exported method IPFSLog.RawHeads should have comment or be unexported (golint)
    • Line 58: warning: exported method IPFSLog.IO should have comment or be unexported (golint)
    • Line 175: warning: exported method IPFSLog.SetIdentity should have comment or be unexported (golint)
    • Line 281: warning: exported method IPFSLog.Get should have comment or be unexported (golint)
    • Line 288: warning: exported method IPFSLog.Has should have comment or be unexported (golint)
    • Line 397: warning: exported type CanAppendContext should have comment or be unexported (golint)
    • Line 401: warning: exported method CanAppendContext.GetLogEntries should have comment or be unexported (golint)
    • Line 412: warning: comment on exported method IPFSLog.Iterator should be of the form "Iterator ..." (golint)
    • Line 948: warning: comment on exported method IPFSLog.ToJSONLog should be of the form "ToJSONLog ..." (golint)
    • Line 968: warning: exported method IPFSLog.GetID should have comment or be unexported (golint)
    • Line 972: warning: exported method IPFSLog.GetEntries should have comment or be unexported (golint)
    • go-ipfs-log/io/cbor/cbor.go
    • Line 25: warning: exported type IOCbor should have comment or be unexported (golint)
    • Line 38: warning: exported type Options should have comment or be unexported (golint)
    • Line 43: warning: exported method IOCbor.DecodeRawJSONLog should have comment or be unexported (golint)
    • Line 54: warning: exported method IOCbor.DecodeRawEntry should have comment or be unexported (golint)
    • Line 85: warning: exported function IO should have comment or be unexported (golint)
    • Line 212: warning: exported method IOCbor.ApplyOptions should have comment or be unexported (golint)
    • Line 227: warning: exported method IOCbor.SetDebug should have comment or be unexported (golint)
    • Line 276: warning: exported method IOCbor.PreSign should have comment or be unexported (golint)
    • Line 312: warning: exported method IOCbor.DecryptLinks should have comment or be unexported (golint)
    • Line 343: warning: exported function NonceRefForEntry should have comment or be unexported (golint)
    • go-ipfs-log/entry/entry.go
    • Line 20: warning: exported type Entry should have comment or be unexported (golint)
    • Line 34: warning: exported method Entry.Defined should have comment or be unexported (golint)
    • Line 38: warning: exported method Entry.New should have comment or be unexported (golint)
    • Line 42: warning: exported method Entry.GetRefs should have comment or be unexported (golint)
    • Line 46: warning: exported method Entry.SetRefs should have comment or be unexported (golint)
    • Line 50: warning: exported method Entry.GetPayload should have comment or be unexported (golint)
    • Line 54: warning: exported method Entry.GetLogID should have comment or be unexported (golint)
    • Line 58: warning: exported method Entry.GetNext should have comment or be unexported (golint)
    • Line 62: warning: exported method Entry.GetV should have comment or be unexported (golint)
    • Line 66: warning: exported method Entry.GetKey should have comment or be unexported (golint)
    • Line 70: warning: exported method Entry.GetSig should have comment or be unexported (golint)
    • Line 74: warning: exported method Entry.GetIdentity should have comment or be unexported (golint)
    • Line 78: warning: exported method Entry.GetHash should have comment or be unexported (golint)
    • Line 82: warning: exported method Entry.GetClock should have comment or be unexported (golint)
    • Line 86: warning: exported method Entry.GetAdditionalData should have comment or be unexported (golint)
    • Line 90: warning: exported method Entry.SetPayload should have comment or be unexported (golint)
    • Line 94: warning: exported method Entry.SetLogID should have comment or be unexported (golint)
    • Line 98: warning: exported method Entry.SetNext should have comment or be unexported (golint)
    • Line 102: warning: exported method Entry.SetV should have comment or be unexported (golint)
    • Line 106: warning: exported method Entry.SetKey should have comment or be unexported (golint)
    • Line 110: warning: exported method Entry.SetSig should have comment or be unexported (golint)
    • Line 114: warning: exported method Entry.SetIdentity should have comment or be unexported (golint)
    • Line 118: warning: exported method Entry.SetHash should have comment or be unexported (golint)
    • Line 122: warning: exported method Entry.SetClock should have comment or be unexported (golint)
    • Line 129: warning: exported method Entry.SetAdditionalDataValue should have comment or be unexported (golint)
    • Line 137: warning: exported function CreateEntry should have comment or be unexported (golint)
    • Line 337: warning: comment on exported method Entry.IsValid should be of the form "IsValid ..." (golint)
    • Line 434: warning: exported function Normalize should have comment or be unexported (golint)
    • Line 504: warning: exported method Entry.IsParent should have comment or be unexported (golint)
    • go-ipfs-log/entry/entry_map.go
    • Line 16: warning: exported method OrderedMap.Reverse should have comment or be unexported (golint)
    • Line 128: warning: exported method OrderedMap.First should have comment or be unexported (golint)
    • Line 142: warning: exported method OrderedMap.Last should have comment or be unexported (golint)
    • go-ipfs-log/entry/lamportclock.go
    • Line 10: warning: exported type LamportClock should have comment or be unexported (golint)
    • Line 15: warning: exported method LamportClock.Defined should have comment or be unexported (golint)
    • Line 19: warning: exported method LamportClock.New should have comment or be unexported (golint)
    • Line 23: warning: exported method LamportClock.SetID should have comment or be unexported (golint)
    • Line 27: warning: exported method LamportClock.SetTime should have comment or be unexported (golint)
    • Line 31: warning: exported method LamportClock.GetID should have comment or be unexported (golint)
    • Line 35: warning: exported method LamportClock.GetTime should have comment or be unexported (golint)
    • go-ipfs-log/accesscontroller/interface.go
    • Line 7: warning: exported type LogEntry should have comment or be unexported (golint)
    • Line 12: warning: exported type CanAppendAdditionalContext should have comment or be unexported (golint)
    • Line 16: warning: exported type Interface should have comment or be unexported (golint)
    • go-ipfs-log/io/jsonable/types.go
    • Line 75: warning: exported method EntryV0.ToPlain should have comment or be unexported (golint)
    • Line 128: warning: exported type IdentitySignature should have comment or be unexported (golint)
    • Line 133: warning: exported type Identity should have comment or be unexported (golint)
    • Line 140: warning: exported type LamportClock should have comment or be unexported (golint)
    • Line 241: warning: exported function ToJsonableLamportClock should have comment or be unexported (golint)
    • Line 306: warning: exported method LamportClock.ToPlain should have comment or be unexported (golint)
    • go-ipfs-log/entry/sorting/sorting.go
    • Line 14: warning: exported function SortByClocks should have comment or be unexported (golint)
    • Line 24: warning: exported function SortByClockID should have comment or be unexported (golint)
    • Line 34: warning: exported function First should have comment or be unexported (golint)
    • Line 38: warning: exported function FirstWriteWins should have comment or be unexported (golint)
    • Line 48: warning: exported function LastWriteWins should have comment or be unexported (golint)
    • Line 60: warning: exported function SortByEntryHash should have comment or be unexported (golint)
    • Line 77: warning: exported function NoZeroes should have comment or be unexported (golint)
    • Line 92: warning: exported function Reverse should have comment or be unexported (golint)
    • Line 99: warning: exported function Compare should have comment or be unexported (golint)
    • Line 108: warning: exported function Sort should have comment or be unexported (golint)
    • go-ipfs-log/test/utils.go
    • Line 13: warning: exported function NewIdentityDataStore should have comment or be unexported (golint)
    • Line 36: warning: exported function CidB32 should have comment or be unexported (golint)
    • Line 45: warning: exported function MustCID should have comment or be unexported (golint)
    • Line 53: warning: exported function MustBytesFromHex should have comment or be unexported (golint)
    • go-ipfs-log/errmsg/errmsg.go
    • Line 10: warning: exported type Error should have comment or be unexported (golint)
    • Line 14: warning: exported method Error.Wrap should have comment or be unexported (golint)
    • Line 17: warning: exported const ErrCBOROperationFailed should have comment (or a comment on this block) or be unexported (golint)
    • go-ipfs-log/io/compatibility.go
    • Line 13: warning: exported type CBOROptions should have comment or be unexported (golint)
    • Line 15: warning: exported function ReadCBOR should have comment or be unexported (golint)
    • Line 24: warning: exported function WriteCBOR should have comment or be unexported (golint)
    • Line 33: warning: exported function CBOR should have comment or be unexported (golint)

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.


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • go-ipfs-log/test/log_load_test.go
    • Line 120: warning: ineffectual assignment to err (ineffassign)
    • Line 121: warning: ineffectual assignment to err (ineffassign)
    • Line 138: warning: ineffectual assignment to err (ineffassign)
    • Line 139: warning: ineffectual assignment to err (ineffassign)
    • Line 619: warning: ineffectual assignment to err (ineffassign)
    • Line 796: warning: ineffectual assignment to err (ineffassign)
    • Line 941: warning: ineffectual assignment to err (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!