Preparing report...

Report for gitlab.com/bertrandbenj/politikojj

A+    Excellent!    Found 40 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!


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.


golint20%

Golint is a linter for Go source code.

    • /gitlab.com/bertrandbenj/politikojj/model/constvote.go
    • Line 4: warning: exported const VoteGrantClaim should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported var AvailableVotes should have comment or be unexported (golint)
    • Line 22: warning: exported const Citizen should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var AvailableRole should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/utilities/utilities.go
    • Line 16: warning: exported function DeferCloses should have comment or be unexported (golint)
    • Line 26: warning: exported function AnnualRateToDailyRate should have comment or be unexported (golint)
    • Line 30: warning: exported function DailyUbi should have comment or be unexported (golint)
    • Line 39: warning: exported function DailyUBI should have comment or be unexported (golint)
    • Line 52: warning: exported function Contains should have comment or be unexported (golint)
    • Line 69: warning: exported function Now should have comment or be unexported (golint)
    • Line 71: warning: exported function ConfigLogger should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/node/blocksmith.go
    • Line 19: warning: exported type BlockDataProcessor should have comment or be unexported (golint)
    • Line 23: warning: exported type BlockSmith should have comment or be unexported (golint)
    • Line 34: warning: exported function NewBlockSmith should have comment or be unexported (golint)
    • Line 118: warning: exported method BlockSmith.RunBlockSmith should have comment or be unexported (golint)
    • Line 132: warning: exported method BlockSmith.CheckForkOrChain should have comment or be unexported (golint)
    • Line 153: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 164: warning: exported method BlockSmith.GenerateBlock should have comment or be unexported (golint)
    • Line 214: warning: exported method BlockSmith.CalculatePow should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/crypto/extra/pgpfunction.go
    • Line 17: warning: comment on exported method PGPPublicKey.EncryptMessage should be of the form "EncryptMessage ..." (golint)
    • Line 52: warning: exported method PGPPrivateKey.DecryptMessage should have comment or be unexported (golint)
    • Line 75: warning: exported function DecryptPrivateKey should have comment or be unexported (golint)
    • Line 95: warning: exported function ReadPubAndPrivateArmorKeyFile should have comment or be unexported (golint)
    • Line 103: warning: comment on exported function ReadArmoredPubFile should be of the form "ReadArmoredPubFile ..." (golint)
    • Line 112: warning: comment on exported function ReadArmoredPrivateFile should be of the form "ReadArmoredPrivateFile ..." (golint)
    • Line 131: warning: exported function DecodeBase64String should have comment or be unexported (golint)
    • Line 141: warning: exported function EncodeBytesToBase64 should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/crypto/hooks.go
    • Line 13: warning: exported type PublicK should have comment or be unexported (golint)
    • Line 14: warning: exported type PrivateK should have comment or be unexported (golint)
    • Line 18: warning: exported type Keypair should have comment or be unexported (golint)
    • Line 23: warning: exported type SerializedKey should have comment or be unexported (golint)
    • Line 29: warning: exported method Keypair.Sign should have comment or be unexported (golint)
    • Line 34: warning: exported method Keypair.Save should have comment or be unexported (golint)
    • Line 56: warning: exported function ParsePublicKey should have comment or be unexported (golint)
    • Line 71: warning: exported method Keypair.PubID should have comment or be unexported (golint)
    • Line 79: warning: exported function LoadKey should have comment or be unexported (golint)
    • Line 99: warning: exported method Keypair.Serialize should have comment or be unexported (golint)
    • Line 110: warning: exported function GenEd25519 should have comment or be unexported (golint)
    • Line 114: warning: exported function Gen should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/pow.go
    • Line 8: warning: exported type PersonalizedAdaptivePoW should have comment or be unexported (golint)
    • Line 14: warning: exported method PersonalizedAdaptivePoW.PartToSign should have comment or be unexported (golint)
    • Line 22: warning: exported method PersonalizedAdaptivePoW.GetNbZerosAndRemainder should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/network/claimapi.go
    • Line 8: warning: exported method RestService.GetClaimRole should have comment or be unexported (golint)
    • Line 12: warning: exported method RestService.GetApprovedClaimRole should have comment or be unexported (golint)
    • Line 16: warning: exported method RestService.PostClaimRole should have comment or be unexported (golint)
    • Line 35: warning: exported method RestService.PostApprovedClaim should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/chain/documents.go
    • Line 9: warning: exported function MakeAmendment should have comment or be unexported (golint)
    • Line 19: warning: exported function MakeClaim should have comment or be unexported (golint)
    • Line 47: warning: exported function MakeApprovedClaim should have comment or be unexported (golint)
    • Line 56: warning: exported function MakeVote should have comment or be unexported (golint)
    • Line 68: warning: exported function MakeTransaction should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/storage/mock/filestorage.go
    • Line 17: warning: exported type IPFSStoreMock should have comment or be unexported (golint)
    • Line 21: warning: exported method IPFSStoreMock.GetObject should have comment or be unexported (golint)
    • Line 32: warning: exported method IPFSStoreMock.PutObject should have comment or be unexported (golint)
    • Line 45: warning: exported function NewFileSystemStore should have comment or be unexported (golint)
    • Line 56: warning: exported method IPFSStoreMock.StoreFile should have comment or be unexported (golint)
    • Line 66: warning: exported method IPFSStoreMock.UpdateHead should have comment or be unexported (golint)
    • Line 71: warning: exported function FileToString should have comment or be unexported (golint)
    • Line 80: warning: exported function StringToFile should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/cratos.go
    • Line 13: warning: exported type OpenBallot should have comment or be unexported (golint)
    • Line 20: warning: exported method OpenBallot.PartToSign should have comment or be unexported (golint)
    • Line 28: warning: exported type Rule should have comment or be unexported (golint)
    • Line 34: warning: exported type Amendment should have comment or be unexported (golint)
    • Line 40: warning: exported method Amendment.PartToSign should have comment or be unexported (golint)
    • Line 54: warning: exported type Roles should have comment or be unexported (golint)
    • Line 59: warning: exported type UnitIntervalVariable should have comment or be unexported (golint)
    • Line 61: warning: exported type CategoryVariable should have comment or be unexported (golint)
    • Line 63: warning: exported type IntegerVariable should have comment or be unexported (golint)
    • Line 69: warning: exported type VoteableVariable should have comment or be unexported (golint)
    • Line 76: warning: exported type Value should have comment or be unexported (golint)
    • Line 78: warning: exported type Ballots should have comment or be unexported (golint)
    • Line 82: warning: exported type Claims should have comment or be unexported (golint)
    • Line 86: warning: exported type Tax should have comment or be unexported (golint)
    • Line 93: warning: exported type Vars should have comment or be unexported (golint)
    • Line 100: warning: exported method Vars.Avg should have comment or be unexported (golint)
    • Line 116: warning: exported type Cratos should have comment or be unexported (golint)
    • Line 127: warning: exported method UnitIntervalVariable.IsLegal should have comment or be unexported (golint)
    • Line 136: warning: exported function ParseUnitIntervalVar should have comment or be unexported (golint)
    • Line 145: warning: exported function ParseIntegerVar should have comment or be unexported (golint)
    • Line 152: warning: exported function ParseCategoryVar should have comment or be unexported (golint)
    • Line 156: warning: exported method UnitIntervalVariable.Description should have comment or be unexported (golint)
    • Line 160: warning: exported method UnitIntervalVariable.FloatValue should have comment or be unexported (golint)
    • Line 164: warning: exported method CategoryVariable.IsLegal should have comment or be unexported (golint)
    • Line 168: warning: exported method CategoryVariable.Description should have comment or be unexported (golint)
    • Line 171: warning: exported method CategoryVariable.FloatValue should have comment or be unexported (golint)
    • Line 178: warning: exported method IntegerVariable.IsLegal should have comment or be unexported (golint)
    • Line 183: warning: exported method IntegerVariable.Description should have comment or be unexported (golint)
    • Line 186: warning: exported method IntegerVariable.FloatValue should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/node/cratosProcessor.go
    • Line 12: warning: exported method CratosProcessingService.IsAuthorized should have comment or be unexported (golint)
    • Line 19: warning: exported type CratosProcessingService should have comment or be unexported (golint)
    • Line 27: warning: exported method CratosProcessingService.ApplyDelta should have comment or be unexported (golint)
    • Line 53: warning: exported method CratosProcessingService.ApplyAmendment should have comment or be unexported (golint)
    • Line 90: warning: exported method CratosProcessingService.ApplyVariableValueChange should have comment or be unexported (golint)
    • Line 120: warning: exported method CratosProcessingService.DeserializeFromCratos should have comment or be unexported (golint)
    • Line 147: warning: exported method CratosProcessingService.SerializeForCratos should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/chain/genesis.go
    • Line 8: warning: exported var InitialRoles should have comment or be unexported (golint)
    • Line 21: warning: exported var InitialRolesInheritance should have comment or be unexported (golint)
    • Line 25: warning: exported method BlockChainService.ClaimCitizenship should have comment or be unexported (golint)
    • Line 34: warning: exported method BlockChainService.ApproveClaim should have comment or be unexported (golint)
    • Line 46: warning: exported method BlockChainService.AddCitizen should have comment or be unexported (golint)
    • Line 60: warning: exported method BlockChainService.Genesis should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/cli.go
    • Line 63: warning: exported function InteractiveAmendment should have comment or be unexported (golint)
    • Line 98: warning: exported function InteractiveVote should have comment or be unexported (golint)
    • Line 115: warning: exported function InteractiveClaim should have comment or be unexported (golint)
    • Line 145: warning: exported function InteractiveTransaction should have comment or be unexported (golint)
    • Line 159: warning: exported function SendDoc should have comment or be unexported (golint)
    • Line 176: warning: exported function ExecuteSubCommand should have comment or be unexported (golint)
    • Line 254: warning: exported function RunAsDaemon should have comment or be unexported (golint)
    • Line 320: warning: exported function CliTX should have comment or be unexported (golint)
    • Line 333: warning: exported function CliClaim should have comment or be unexported (golint)
    • Line 341: warning: exported function CliVote should have comment or be unexported (golint)
    • Line 349: warning: exported function CliPropose should have comment or be unexported (golint)
    • Line 356: warning: exported function CliDaemon should have comment or be unexported (golint)
    • Line 388: warning: exported function ScanX should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/network/restserver.go
    • Line 24: warning: exported type RestService should have comment or be unexported (golint)
    • Line 30: warning: exported function NewRest should have comment or be unexported (golint)
    • Line 77: warning: exported method RestService.GetPools should have comment or be unexported (golint)
    • Line 81: warning: exported method RestService.FileHandler should have comment or be unexported (golint)
    • Line 87: warning: exported method RestService.StartupRest should have comment or be unexported (golint)
    • Line 146: warning: exported method RestService.HandleKeyGen should have comment or be unexported (golint)
    • Line 166: warning: exported method RestService.DecodeReceivedJSON should have comment or be unexported (golint)
    • Line 190: warning: exported method RestService.VerifySignable should have comment or be unexported (golint)
    • Line 204: warning: exported method RestService.StoreToIPFS should have comment or be unexported (golint)
    • Line 214: warning: exported method RestService.GetAvailables should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/chain/chain.go
    • Line 12: warning: exported type UnpackedBlock should have comment or be unexported (golint)
    • Line 23: warning: exported method UnpackedBlock.Majority should have comment or be unexported (golint)
    • Line 27: warning: exported type WalkHandler should have comment or be unexported (golint)
    • Line 29: warning: exported type BlockChainService should have comment or be unexported (golint)
    • Line 37: warning: exported method BlockChainService.GetHead should have comment or be unexported (golint)
    • Line 43: warning: exported function NewChain should have comment or be unexported (golint)
    • Line 57: warning: exported method BlockChainService.HeadBlock should have comment or be unexported (golint)
    • Line 70: warning: exported method BlockChainService.BackwardWalk should have comment or be unexported (golint)
    • Line 84: warning: exported method BlockChainService.ByIndex should have comment or be unexported (golint)
    • Line 117: warning: exported method BlockChainService.ChainBlock should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/crypto/extra/pgpbinding.go
    • Line 14: warning: exported var PGPDefaultConf should have comment or be unexported (golint)
    • Line 18: warning: don't use underscores in Go names; const KeyType_OpenPGP should be KeyTypeOpenPGP (golint)
    • Line 18: warning: exported const KeyType_OpenPGP should have comment or be unexported (golint)
    • Line 20: warning: exported type PGPPrivateKey should have comment or be unexported (golint)
    • Line 24: warning: comment on exported type PGPPublicKey should be of the form "PGPPublicKey ..." (with optional leading article) (golint)
    • Line 29: warning: exported method PGPPrivateKey.Bytes should have comment or be unexported (golint)
    • Line 33: warning: exported method PGPPrivateKey.Equals should have comment or be unexported (golint)
    • Line 43: warning: exported method PGPPrivateKey.Raw should have comment or be unexported (golint)
    • Line 47: warning: exported method PGPPrivateKey.Type should have comment or be unexported (golint)
    • Line 51: warning: exported method PGPPrivateKey.Sign should have comment or be unexported (golint)
    • Line 60: warning: exported method PGPPrivateKey.GetPublic should have comment or be unexported (golint)
    • Line 64: warning: exported method PGPPublicKey.Bytes should have comment or be unexported (golint)
    • Line 68: warning: exported method PGPPublicKey.Equals should have comment or be unexported (golint)
    • Line 78: warning: exported method PGPPublicKey.Raw should have comment or be unexported (golint)
    • Line 82: warning: exported method PGPPublicKey.Type should have comment or be unexported (golint)
    • Line 86: warning: exported method PGPPublicKey.Verify should have comment or be unexported (golint)
    • Line 94: warning: exported function PGPPubUnmarshaller should have comment or be unexported (golint)
    • Line 99: warning: exported function PGPPrivUnmarshaller should have comment or be unexported (golint)
    • Line 123: warning: exported function ArmoredEntityReader should have comment or be unexported (golint)
    • Line 131: warning: exported function GeneratePGPKeyPair should have comment or be unexported (golint)
    • Line 164: warning: exported function RegisterOpenPGPBinding should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/currency.go
    • Line 8: warning: exported type Currency should have comment or be unexported (golint)
    • Line 20: warning: exported type Wallet should have comment or be unexported (golint)
    • Line 25: warning: exported type JointWallet should have comment or be unexported (golint)
    • Line 30: warning: exported type PublicWallet should have comment or be unexported (golint)
    • Line 34: warning: exported type PublicAccount should have comment or be unexported (golint)
    • Line 39: warning: exported type Transaction should have comment or be unexported (golint)
    • Line 45: warning: exported method Transaction.PartToSign should have comment or be unexported (golint)
    • Line 52: warning: exported method Currency.SumAccounts should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/storage/ipfsstorage.go
    • Line 18: warning: exported type IPFSStorage should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method IPFSStorage.PutObject should be of the form "PutObject ..." (golint)
    • Line 41: warning: exported method IPFSStorage.UpdateHead should have comment or be unexported (golint)
    • Line 49: warning: exported method IPFSStorage.StoreFile should have comment or be unexported (golint)
    • Line 70: warning: exported method IPFSStorage.GetObject should have comment or be unexported (golint)
    • Line 82: warning: exported function NewIPFSStore should have comment or be unexported (golint)
    • Line 90: warning: exported method IPFSStorage.TestIPFS should have comment or be unexported (golint)
    • Line 95: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 120: warning: exported method IPFSStorage.ManualDagGet should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/network/chainapi.go
    • Line 12: warning: exported method RestService.PostBlock should have comment or be unexported (golint)
    • Line 24: warning: exported method RestService.GetCratos should have comment or be unexported (golint)
    • Line 32: warning: exported method RestService.GetCCY should have comment or be unexported (golint)
    • Line 40: warning: exported method RestService.GetDemos should have comment or be unexported (golint)
    • Line 48: warning: exported method RestService.GetHeadCid should have comment or be unexported (golint)
    • Line 52: warning: exported method RestService.GetBlock should have comment or be unexported (golint)
    • Line 62: warning: exported method RestService.GetBlockchain should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/network/p2pserver.go
    • Line 25: warning: exported type ServerP2P should have comment or be unexported (golint)
    • Line 43: warning: exported method ServerP2P.Update should have comment or be unexported (golint)
    • Line 49: warning: exported method ServerP2P.GetID should have comment or be unexported (golint)
    • Line 53: warning: exported function NewP2P should have comment or be unexported (golint)
    • Line 202: warning: exported method ServerP2P.RunMDNS should have comment or be unexported (golint)
    • Line 244: warning: comment on exported type AddrList should be of the form "AddrList ..." (with optional leading article) (golint)
    • Line 255: warning: exported method AddrList.Set should have comment or be unexported (golint)
    • Line 264: warning: exported function StringsToAddrs should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/abstract.go
    • Line 8: warning: comment on exported type SignedStampedDoc should be of the form "SignedStampedDoc ..." (with optional leading article) (golint)
    • Line 15: warning: exported method SignedStampedDoc.Stamp should have comment or be unexported (golint)
    • Line 21: warning: exported method SignedStampedDoc.PartToSign should have comment or be unexported (golint)
    • Line 25: warning: exported method SignedStampedDoc.Details should have comment or be unexported (golint)
    • Line 30: warning: exported method SignedStampedDoc.GetSignature should have comment or be unexported (golint)
    • Line 33: warning: exported method SignedStampedDoc.GetPublicKey should have comment or be unexported (golint)
    • Line 37: warning: exported type Signable should have comment or be unexported (golint)
    • Line 45: warning: comment on exported type Observable should be of the form "Observable ..." (with optional leading article) (golint)
    • Line 51: warning: exported type Observer should have comment or be unexported (golint)
    • Line 56: warning: exported type ObservableList should have comment or be unexported (golint)
    • Line 60: warning: exported method ObservableList.Register should have comment or be unexported (golint)
    • Line 64: warning: exported method ObservableList.Deregister should have comment or be unexported (golint)
    • Line 68: warning: exported method ObservableList.NotifyAll should have comment or be unexported (golint)
    • Line 85: warning: comment on exported type CidLink should be of the form "CidLink ..." (with optional leading article) (golint)
    • Line 90: warning: exported type Evidence should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/block.go
    • Line 14: warning: exported const DtDiffEval should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported var MinGenTime should have comment or be unexported (golint)
    • Line 19: warning: exported var MaxGenTime should have comment or be unexported (golint)
    • Line 20: warning: exported var MaxSpeed should have comment or be unexported (golint)
    • Line 21: warning: exported var MinSpeed should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type Block should be of the form "Block ..." (with optional leading article) (golint)
    • Line 43: warning: exported method Block.IsHashValid should have comment or be unexported (golint)
    • Line 107: warning: exported method Block.HashPow should have comment or be unexported (golint)
    • Line 115: warning: exported method Block.Redacted should have comment or be unexported (golint)
    • Line 120: warning: exported method Block.PartToSign should have comment or be unexported (golint)
    • Line 140: warning: exported method Block.PartToHash should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/constamendment.go
    • Line 18: warning: exported var AvailablePropose should have comment or be unexported (golint)
    • Line 35: warning: exported var AvailableTaxType should have comment or be unexported (golint)
    • Line 44: warning: exported var AvailableVariableTax should have comment or be unexported (golint)
    • Line 46: warning: comment on exported var InstallAmendment should be of the form "InstallAmendment ..." (golint)
    • Line 118: warning: comment on exported var VerifyPredicate should be of the form "VerifyPredicate ..." (golint)
    • /gitlab.com/bertrandbenj/politikojj/node/pools.go
    • Line 9: warning: comment on exported type TemporaryPool should be of the form "TemporaryPool ..." (with optional leading article) (golint)
    • Line 20: warning: exported function NewPool should have comment or be unexported (golint)
    • Line 30: warning: exported method TemporaryPool.GetVotes should have comment or be unexported (golint)
    • Line 36: warning: exported method TemporaryPool.GetTxs should have comment or be unexported (golint)
    • Line 42: warning: exported method TemporaryPool.CountVotes should have comment or be unexported (golint)
    • Line 58: warning: exported method TemporaryPool.Remove should have comment or be unexported (golint)
    • Line 69: warning: exported method TemporaryPool.Exists should have comment or be unexported (golint)
    • Line 96: warning: exported method TemporaryPool.Add should have comment or be unexported (golint)
    • Line 144: warning: exported method TemporaryPool.Attach should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/network/cratosapi.go
    • Line 8: warning: exported method RestService.PostVote should have comment or be unexported (golint)
    • Line 19: warning: exported method RestService.PostAmendment should have comment or be unexported (golint)
    • Line 39: warning: comment on exported method RestService.VerifyRuleDataType should be of the form "VerifyRuleDataType ..." (golint)
    • Line 50: warning: exported method RestService.GetRBAC should have comment or be unexported (golint)
    • /gitlab.com/bertrandbenj/politikojj/model/claim.go
    • Line 8: warning: exported const ClaimExpiry should have comment or be unexported (golint)
    • Line 10: warning: exported type Claim should have comment or be unexported (golint)
    • Line 16: warning: exported type ApprovedClaim should have comment or be unexported (golint)
    • Line 21: warning: exported type Expirable should have comment or be unexported (golint)
    • Line 25: warning: exported method Claim.Expired should have comment or be unexported (golint)
    • Line 29: warning: exported method Claim.PartToSign should have comment or be unexported (golint)
    • Line 36: warning: exported method ApprovedClaim.PartToSign should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!