Preparing report...

Report for github.com/iden3/go-iden3

A+    Excellent!    Found 41 issues across 89 files

Tweet

gofmt97%

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!


gocyclo97%

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.

    • go-iden3/identity/issuer/issuer.go
    • Line 648: warning: cyclomatic complexity 24 of function (*Issuer).PublishState() is high (> 15) (gocyclo)
    • Line 251: warning: cyclomatic complexity 18 of function Create() is high (> 15) (gocyclo)
    • Line 488: warning: cyclomatic complexity 18 of function (*Issuer).SyncIdenStatePublic() is high (> 15) (gocyclo)
    • Line 364: warning: cyclomatic complexity 17 of function Load() is high (> 15) (gocyclo)

golint57%

Golint is a linter for Go source code.

    • go-iden3/db/admin.go
    • Line 8: warning: exported method LevelDbStorage.RawDump should have comment or be unexported (golint)
    • Line 17: warning: exported function IPFSexport should have comment or be unexported (golint)
    • go-iden3/db/storage.go
    • Line 7: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 9: warning: exported type KV should have comment or be unexported (golint)
    • Line 14: warning: exported type Storage should have comment or be unexported (golint)
    • Line 24: warning: exported type Tx should have comment or be unexported (golint)
    • go-iden3/core/claims/claimBasic.go
    • Line 8: warning: exported const IndexSlotLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 64: warning: exported method ClaimBasic.Metadata should have comment or be unexported (golint)
    • go-iden3/core/claims/claimKeyBabyJub.go
    • Line 13: warning: exported const BabyJubKeyTypeGeneric should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type BabyJubKeyType should have comment or be unexported (golint)
    • Line 81: warning: exported method ClaimKeyBabyJub.Metadata should have comment or be unexported (golint)
    • go-iden3/core/claims/claim_types.go
    • Line 16: warning: exported var ClaimTypeStringBasic should have comment or be unexported (golint)
    • Line 45: warning: exported method ClaimType.MarshalText should have comment or be unexported (golint)
    • Line 60: warning: exported method ClaimType.UnmarshalText should have comment or be unexported (golint)
    • Line 132: warning: exported var ClaimHeaderBasic should have comment or be unexported (golint)
    • go-iden3/keystore/keystore.go
    • Line 50: warning: exported var ErrStorageLock should have comment or be unexported (golint)
    • Line 57: warning: comment on exported type PrefixType should be of the form "PrefixType ..." (with optional leading article) (golint)
    • Line 93: warning: comment on exported function EncryptData should be of the form "EncryptData ..." (golint)
    • Line 183: warning: comment on exported method FileStorage.TryLock should be of the form "TryLock ..." (golint)
    • Line 190: warning: comment on exported method FileStorage.Unlock should be of the form "Unlock ..." (golint)
    • Line 267: warning: exported method KeyStore.Close should have comment or be unexported (golint)
    • Line 313: warning: exported method KeyStore.ExportKey should have comment or be unexported (golint)
    • go-iden3/components/idensigner/idensigner.go
    • Line 14: warning: exported type IdenSigner should have comment or be unexported (golint)
    • Line 25: warning: exported method IdenSigner.PublicKey should have comment or be unexported (golint)
    • Line 29: warning: exported method IdenSigner.SignEthMsg should have comment or be unexported (golint)
    • Line 38: warning: exported method IdenSigner.SignEthMsgDate should have comment or be unexported (golint)
    • go-iden3/components/idenpubonchain/local/local.go
    • Line 19: warning: exported type IdenStateHistory should have comment or be unexported (golint)
    • Line 25: warning: exported function NewIdenStateHistory should have comment or be unexported (golint)
    • Line 33: warning: exported method IdenStateHistory.Add should have comment or be unexported (golint)
    • Line 39: warning: exported type IdIdenStateData should have comment or be unexported (golint)
    • go-iden3/core/proof/proof.go
    • Line 13: warning: exported type IdenStateData should have comment or be unexported (golint)
    • Line 19: warning: exported type CredentialExistence should have comment or be unexported (golint)
    • Line 34: warning: exported type CredentialValidity should have comment or be unexported (golint)
    • go-iden3/identity/holder/holder.go
    • Line 28: warning: exported const ErrStrTooManySiblings should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported var ErrRevokedClaim should have comment or be unexported (golint)
    • Line 38: warning: exported var ConfigDefault should have comment or be unexported (golint)
    • Line 40: warning: exported type Config should have comment or be unexported (golint)
    • Line 65: warning: comment on exported function Load should be of the form "Load ..." (golint)
    • go-iden3/components/idenpuboffchain/writermock/writermock.go
    • Line 9: warning: exported type IdenPubOffChainWriteMock should have comment or be unexported (golint)
    • Line 13: warning: exported function New should have comment or be unexported (golint)
    • Line 17: warning: exported method IdenPubOffChainWriteMock.Publish should have comment or be unexported (golint)
    • Line 22: warning: exported method IdenPubOffChainWriteMock.Url should have comment or be unexported (golint)
    • go-iden3/db/memory.go
    • Line 8: warning: exported type MemoryStorage should have comment or be unexported (golint)
    • Line 13: warning: exported type MemoryStorageTx should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMemoryStorage should have comment or be unexported (golint)
    • Line 23: warning: exported method MemoryStorage.Info should have comment or be unexported (golint)
    • Line 27: warning: exported method MemoryStorage.WithPrefix should have comment or be unexported (golint)
    • Line 27: warning: receiver name m should be consistent with previous receiver name l for MemoryStorage (golint)
    • Line 31: warning: exported method MemoryStorage.NewTx should have comment or be unexported (golint)
    • Line 31: warning: receiver name m should be consistent with previous receiver name l for MemoryStorage (golint)
    • Line 44: warning: exported method MemoryStorage.Iterate should have comment or be unexported (golint)
    • Line 66: warning: exported method MemoryStorageTx.Get should have comment or be unexported (golint)
    • Line 78: warning: exported method MemoryStorageTx.Put should have comment or be unexported (golint)
    • Line 82: warning: exported method MemoryStorageTx.Commit should have comment or be unexported (golint)
    • Line 90: warning: exported method MemoryStorageTx.Add should have comment or be unexported (golint)
    • Line 97: warning: exported method MemoryStorageTx.Close should have comment or be unexported (golint)
    • Line 101: warning: exported method MemoryStorage.Close should have comment or be unexported (golint)
    • Line 101: warning: receiver name m should be consistent with previous receiver name l for MemoryStorage (golint)
    • Line 104: warning: exported method MemoryStorage.List should have comment or be unexported (golint)
    • go-iden3/components/idenpuboffchain/writerhttp/writerhttp.go
    • Line 15: warning: exported var ErrIdenStateNotFound should have comment or be unexported (golint)
    • Line 29: warning: exported type Config should have comment or be unexported (golint)
    • Line 34: warning: exported function NewConfigDefault should have comment or be unexported (golint)
    • Line 80: warning: exported method IdenPubOffChainWriteHttp.Url should have comment or be unexported (golint)
    • go-iden3/core/claims/claimOtherIden.go
    • Line 9: warning: exported const IndexSubjectSlotLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: exported method ClaimOtherIden.Metadata should have comment or be unexported (golint)
    • go-iden3/core/claims/utils.go
    • Line 10: warning: exported type ClaimGeneric should have comment or be unexported (golint)
    • Line 15: warning: exported function NewClaimGeneric should have comment or be unexported (golint)
    • Line 21: warning: exported method ClaimGeneric.Entry should have comment or be unexported (golint)
    • Line 26: warning: exported method ClaimGeneric.Metadata should have comment or be unexported (golint)
    • Line 30: warning: exported function HexToClaimGeneric should have comment or be unexported (golint)
    • Line 47: warning: exported function HexArrayToClaimGenericArray should have comment or be unexported (golint)
    • Line 59: warning: exported function ClaimToHex should have comment or be unexported (golint)
    • Line 64: warning: exported function ClaimArrayToHexArray should have comment or be unexported (golint)
    • go-iden3/identity/issuer/issuer.go
    • Line 35: warning: exported var ErrIdenGenesisOnly should have comment or be unexported (golint)
    • Line 69: warning: exported var SigPrefixSetState should have comment or be unexported (golint)
    • Line 146: warning: exported method Issuer.IdenStateOnChain should have comment or be unexported (golint)
    • Line 154: warning: exported method Issuer.IdenStatePending should have comment or be unexported (golint)
    • Line 165: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 173: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 882: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 903: warning: exported type IdOwnershipGenesisInputs should have comment or be unexported (golint)
    • Line 912: warning: exported method Issuer.GenIdOwnershipGenesisInputs should have comment or be unexported (golint)
    • Line 944: warning: exported method Issuer.GenZkProofIdenStateUpdate should have comment or be unexported (golint)
    • go-iden3/merkletree/utils.go
    • Line 19: warning: exported function NewHashFromBigInt should have comment or be unexported (golint)
    • Line 24: warning: exported method Hash.BigInt should have comment or be unexported (golint)
    • Line 44: warning: exported method Hash.MarshalText should have comment or be unexported (golint)
    • Line 48: warning: exported method Hash.UnmarshalText should have comment or be unexported (golint)
    • Line 52: warning: exported method Hash.Equals should have comment or be unexported (golint)
    • Line 52: warning: receiver name h1 should be consistent with previous receiver name h for Hash (golint)
    • Line 56: warning: exported function ElemBytesToBigInts should have comment or be unexported (golint)
    • Line 64: warning: exported function ElemBytesToPoseidonInput should have comment or be unexported (golint)
    • Line 124: warning: exported function NewEntryFromHexs should have comment or be unexported (golint)
    • Line 132: warning: exported function HexsToData should have comment or be unexported (golint)
    • Line 147: warning: exported function NewDataFromBytes should have comment or be unexported (golint)
    • Line 155: warning: exported function NewEntryFromBytes should have comment or be unexported (golint)
    • Line 164: warning: exported function NewEntryFromIntArray should have comment or be unexported (golint)
    • Line 168: warning: exported function NewEntryFromInts should have comment or be unexported (golint)
    • Line 173: warning: exported function IntArrayToData should have comment or be unexported (golint)
    • Line 177: warning: exported function IntsToData should have comment or be unexported (golint)
    • Line 182: warning: exported function BigIntsToData should have comment or be unexported (golint)
    • go-iden3/utils/zk/zk.go
    • Line 210: warning: exported type ProvingKeyFormat should have comment or be unexported (golint)
    • Line 213: warning: exported const ProvingKeyFormatJSON should have comment (or a comment on this block) or be unexported (golint)
    • Line 218: warning: exported type ZkFilesBasename should have comment or be unexported (golint)
    • Line 464: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 613: warning: exported method PubSignals.MarshalJSON should have comment or be unexported (golint)
    • Line 622: warning: exported method PubSignals.UnmarshalJSON should have comment or be unexported (golint)
    • go-iden3/components/idenpuboffchain/local/local.go
    • Line 12: warning: exported type IdenPubOffChainIden should have comment or be unexported (golint)
    • Line 17: warning: exported type IdenPubOffChain should have comment or be unexported (golint)
    • Line 23: warning: exported function NewIdenPubOffChain should have comment or be unexported (golint)
    • Line 30: warning: exported method IdenPubOffChain.GetPublicData should have comment or be unexported (golint)
    • Line 50: warning: exported method IdenPubOffChain.Url should have comment or be unexported (golint)
    • Line 54: warning: exported method IdenPubOffChain.Publish should have comment or be unexported (golint)
    • go-iden3/db/storageutils.go
    • Line 88: warning: comment on exported method StorageList.Get should be of the form "Get ..." (golint)
    • Line 105: warning: exported function StoreJSON should have comment or be unexported (golint)
    • Line 114: warning: exported function LoadJSON should have comment or be unexported (golint)
    • go-iden3/components/idenpubonchain/idenpubonchain.go
    • Line 21: warning: exported var ErrIdenNotOnChain should have comment or be unexported (golint)
    • Line 186: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 207: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • go-iden3/core/claims/claim.go
    • Line 24: warning: exported function GetRevocationNonce should have comment or be unexported (golint)
    • Line 31: warning: exported const ClaimFlagsLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 75: warning: exported const ClaimSubjectStringSelf should have comment (or a comment on this block) or be unexported (golint)
    • Line 86: warning: exported method ClaimSubject.MarshalText should have comment or be unexported (golint)
    • Line 101: warning: exported method ClaimSubject.UnmarshalText should have comment or be unexported (golint)
    • Line 121: warning: exported const ClaimSubjectPosStringIndex should have comment (or a comment on this block) or be unexported (golint)
    • Line 122: warning: comment on exported const ClaimSubjectPosValue should be of the form "ClaimSubjectPosValue ..." (golint)
    • Line 127: warning: exported method ClaimSubjectPos.MarshalText should have comment or be unexported (golint)
    • Line 140: warning: exported method ClaimSubjectPos.UnmarshalText should have comment or be unexported (golint)
    • Line 288: warning: exported method Metadata.MarshalJSON should have comment or be unexported (golint)
    • Line 307: warning: exported method Metadata.UnmarshalJSON should have comment or be unexported (golint)
    • go-iden3/merkletree/merkletree.go
    • Line 35: warning: exported function NewElemBytesFromBigInt should have comment or be unexported (golint)
    • Line 41: warning: exported method ElemBytes.BigInt should have comment or be unexported (golint)
    • Line 73: warning: exported method Data.Bytes should have comment or be unexported (golint)
    • Line 80: warning: exported method Data.Equal should have comment or be unexported (golint)
    • Line 80: warning: receiver name d1 should be consistent with previous receiver name d for Data (golint)
    • Line 85: warning: exported method Data.MarshalText should have comment or be unexported (golint)
    • Line 90: warning: exported method Data.UnmarshalText should have comment or be unexported (golint)
    • Line 147: warning: exported type Entrier should have comment or be unexported (golint)
    • Line 151: warning: exported method Entry.Index should have comment or be unexported (golint)
    • Line 155: warning: exported method Entry.Value should have comment or be unexported (golint)
    • Line 193: warning: exported method Entry.Bytes should have comment or be unexported (golint)
    • Line 198: warning: exported method Entry.Equal should have comment or be unexported (golint)
    • Line 198: warning: receiver name e1 should be consistent with previous receiver name e for Entry (golint)
    • Line 202: warning: exported method Entry.MarshalText should have comment or be unexported (golint)
    • Line 206: warning: exported method Entry.UnmarshalText should have comment or be unexported (golint)
    • Line 210: warning: exported method Entry.Clone should have comment or be unexported (golint)
    • Line 254: warning: exported method MerkleTree.Snapshot should have comment or be unexported (golint)
    • Line 301: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 362: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 440: warning: exported function CheckEntryInField should have comment or be unexported (golint)
    • Line 729: warning: comment on exported method MerkleTree.ImportDumpedClaims should be of the form "ImportDumpedClaims ..." (golint)
    • Line 842: warning: exported method Proof.MarshalJSON should have comment or be unexported (golint)
    • Line 846: warning: exported method Proof.UnmarshalJSON should have comment or be unexported (golint)
    • Line 909: warning: exported method Proof.AllSiblings should have comment or be unexported (golint)
    • Line 913: warning: exported method Proof.AllSiblingsCircom should have comment or be unexported (golint)
    • Line 955: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-iden3/db/leveldb.go
    • Line 13: warning: exported type LevelDbStorage should have comment or be unexported (golint)
    • Line 18: warning: exported type LevelDbStorageTx should have comment or be unexported (golint)
    • Line 23: warning: exported function NewLevelDbStorage should have comment or be unexported (golint)
    • Line 39: warning: exported method LevelDbStorage.Info should have comment or be unexported (golint)
    • Line 69: warning: exported method LevelDbStorage.WithPrefix should have comment or be unexported (golint)
    • Line 73: warning: exported method LevelDbStorage.NewTx should have comment or be unexported (golint)
    • Line 86: warning: exported method LevelDbStorage.Iterate should have comment or be unexported (golint)
    • Line 124: warning: comment on exported method LevelDbStorageTx.Put should be of the form "Put ..." (golint)
    • Line 125: warning: receiver name tx should be consistent with previous receiver name l for LevelDbStorageTx (golint)
    • Line 129: warning: exported method LevelDbStorageTx.Add should have comment or be unexported (golint)
    • Line 129: warning: receiver name tx should be consistent with previous receiver name l for LevelDbStorageTx (golint)
    • Line 136: warning: exported method LevelDbStorageTx.Commit should have comment or be unexported (golint)
    • Line 147: warning: exported method LevelDbStorageTx.Close should have comment or be unexported (golint)
    • Line 151: warning: exported method LevelDbStorage.Close should have comment or be unexported (golint)
    • Line 158: warning: exported method LevelDbStorage.LevelDB should have comment or be unexported (golint)
    • Line 162: warning: exported method LevelDbStorage.List should have comment or be unexported (golint)
    • go-iden3/components/httpclient/httpclient.go
    • Line 11: warning: exported type ServerError should have comment or be unexported (golint)
    • Line 19: warning: exported type HttpClient should have comment or be unexported (golint)
    • Line 25: warning: exported function NewHttpClient should have comment or be unexported (golint)
    • Line 34: warning: exported method HttpClient.NewRequest should have comment or be unexported (golint)
    • Line 38: warning: exported method HttpClient.DoRequest should have comment or be unexported (golint)
    • go-iden3/core/id.go
    • Line 48: warning: exported method ID.BigInt should have comment or be unexported (golint)
    • Line 54: warning: exported method ID.Equal should have comment or be unexported (golint)
    • Line 54: warning: receiver name id1 should be consistent with previous receiver name id for ID (golint)
    • Line 63: warning: exported method ID.MarshalText should have comment or be unexported (golint)
    • Line 68: warning: exported method ID.UnmarshalText should have comment or be unexported (golint)
    • Line 76: warning: exported method ID.Equals should have comment or be unexported (golint)
    • Line 76: warning: receiver name id1 should be consistent with previous receiver name id for ID (golint)
    • Line 116: warning: comment on exported function CalculateChecksum should be of the form "CalculateChecksum ..." (golint)
    • go-iden3/eth/client.go
    • Line 22: warning: exported var ErrAccountNil should have comment or be unexported (golint)
    • Line 25: warning: comment on exported var ErrReceiptNotReceived should be of the form "ErrReceiptNotReceived ..." (golint)
    • Line 95: warning: exported type ContractData should have comment or be unexported (golint)
    • Line 154: warning: context.Context should be the first parameter of a function (golint)
    • go-iden3/components/idenpubonchain/deploy.go
    • Line 12: warning: exported type StateDepsAddresses should have comment or be unexported (golint)
    • Line 16: warning: exported type DeployStateResult should have comment or be unexported (golint)
    • Line 21: warning: exported function DeployState should have comment or be unexported (golint)
    • Line 34: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 47: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • go-iden3/components/idenpubonchain/mock/mock.go
    • Line 12: warning: exported type IdenPubOnChainMock should have comment or be unexported (golint)
    • Line 16: warning: exported function New should have comment or be unexported (golint)
    • Line 20: warning: exported method IdenPubOnChainMock.GetState should have comment or be unexported (golint)
    • Line 25: warning: exported method IdenPubOnChainMock.GetStateByBlock should have comment or be unexported (golint)
    • Line 30: warning: exported method IdenPubOnChainMock.GetStateByTime should have comment or be unexported (golint)
    • Line 35: warning: exported method IdenPubOnChainMock.InitState should have comment or be unexported (golint)
    • Line 40: warning: exported method IdenPubOnChainMock.SetState should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • go-iden3/components/idenpubonchain/deploy.go
    • Line 9: warning: no required module provides package github.com/iden3/go-iden3-core/eth/contracts; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)
    • /home/shawn/mygo/src/github.com/gojp/goreportcard/_repos/src/github.com/iden3/go-iden3/components/idenpubonchain/deploy.go
    • Line 9: warning: no required module provides package github.com/iden3/go-iden3-core/eth/contracts; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)
    • Line 9: warning: no required module provides package github.com/iden3/go-iden3-core/eth/contracts; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)
    • Line 9: warning: no required module provides package github.com/iden3/go-iden3-core/eth/contracts; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)
    • Line 9: warning: no required module provides package github.com/iden3/go-iden3-core/eth/contracts; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/iden3/go-iden3-core/eth/contracts (invalid package name: "") (ineffassign)

misspell93%

Misspell Finds commonly misspelled English words

    • go-iden3/eth/client.go
    • Line 104: warning: "ocurred" is a misspelling of "occurred" (misspell)
    • Line 105: warning: "successfull" is a misspelling of "successful" (misspell)
    • Line 179: warning: "Successfull" is a misspelling of "Successful" (misspell)