Preparing report...

Report for github.com/threefoldtech/rivine

A+    Excellent!    Found 82 issues across 320 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!


gocyclo85%

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.

    • rivine/persist/json_test.go
    • Line 116: warning: cyclomatic complexity 38 of function TestLoadJSONCorruptedFiles() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 20 of function TestSaveLoadJSON() is high (> 15) (gocyclo)
    • rivine/pkg/client/walletcmd.go
    • Line 828: warning: cyclomatic complexity 35 of function (*walletCmd).listTransactionsCmd() is high (> 15) (gocyclo)
    • Line 1073: warning: cyclomatic complexity 16 of function (*walletCmd).listLockedCmd() is high (> 15) (gocyclo)
    • Line 996: warning: cyclomatic complexity 16 of function (*walletCmd).listUnlockedCmd() is high (> 15) (gocyclo)
    • Line 731: warning: cyclomatic complexity 16 of function (*walletCmd).balanceCmd() is high (> 15) (gocyclo)
    • rivine/modules/wallet/update.go
    • Line 43: warning: cyclomatic complexity 23 of function (*Wallet).updateConfirmedSet() is high (> 15) (gocyclo)
    • Line 188: warning: cyclomatic complexity 21 of function (*Wallet).applyHistory() is high (> 15) (gocyclo)
    • rivine/pkg/client/atomicswap.go
    • Line 737: warning: cyclomatic complexity 28 of function (*atomicSwapCmd).extractSecretCmd() is high (> 15) (gocyclo)
    • Line 525: warning: cyclomatic complexity 20 of function (*atomicSwapCmd).auditCmd() is high (> 15) (gocyclo)
    • Line 638: warning: cyclomatic complexity 16 of function (*atomicSwapCmd).auditAtomicSwapContract() is high (> 15) (gocyclo)
    • rivine/pkg/api/explorer.go
    • Line 518: warning: cyclomatic complexity 22 of function getUnconfirmedTransactions() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 19 of function NewExplorerHashHandler() is high (> 15) (gocyclo)
    • rivine/caddy-plugin/reverseproxy.go
    • Line 155: warning: cyclomatic complexity 29 of function NewSingleHostReverseProxy() is high (> 15) (gocyclo)
    • Line 342: warning: cyclomatic complexity 26 of function (*ReverseProxy).ServeHTTP() is high (> 15) (gocyclo)
    • rivine/sync/threadgroup_test.go
    • Line 79: warning: cyclomatic complexity 20 of function TestThreadGroupStop() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 18 of function TestThreadGroupSiaExample() is high (> 15) (gocyclo)
    • rivine/modules/gateway/peers_test.go
    • Line 562: warning: cyclomatic complexity 29 of function TestOverloadedBootstrap() is high (> 15) (gocyclo)
    • Line 685: warning: cyclomatic complexity 20 of function TestPeerManagerPriority() is high (> 15) (gocyclo)
    • Line 163: warning: cyclomatic complexity 19 of function TestListen() is high (> 15) (gocyclo)
    • rivine/extensions/authcointx/csplugin.go
    • Line 187: warning: cyclomatic complexity 20 of function (*Plugin).ApplyTransaction() is high (> 15) (gocyclo)
    • Line 692: warning: cyclomatic complexity 19 of function (*Plugin).validateAuthAddressUpdateTx() is high (> 15) (gocyclo)
    • Line 299: warning: cyclomatic complexity 16 of function (*Plugin).RevertTransaction() is high (> 15) (gocyclo)

golint92%

Golint is a linter for Go source code.

    • rivine/sandbox/proofofblockstake.go
    • Line 17: warning: exported var BLOCKDELAY should have comment or be unexported (golint)
    • Line 18: warning: exported var PERIOD should have comment or be unexported (golint)
    • Line 19: warning: exported var DIFF_REFRESH should have comment or be unexported (golint)
    • Line 20: warning: exported var DIFF_STRENGTH should have comment or be unexported (golint)
    • Line 29: warning: exported type UTXO should have comment or be unexported (golint)
    • Line 39: warning: exported type BSParameters should have comment or be unexported (golint)
    • Line 117: warning: comment on exported method BSParameters.UpdateStakeModifier should be of the form "UpdateStakeModifier ..." (golint)
    • Line 130: warning: exported method BSParameters.UpdateDifficulty should have comment or be unexported (golint)
    • Line 167: warning: comment on exported function BlockCreation should be of the form "BlockCreation ..." (golint)
    • Line 188: warning: comment on exported function CalcGenesisBlocks should be of the form "CalcGenesisBlocks ..." (golint)
    • rivine/cmd/rivinecg/pkg/config/github_template.go
    • Line 60: warning: exported type TemplateConfig should have comment or be unexported (golint)
    • Line 64: warning: exported type TemplateFrontendConfig should have comment or be unexported (golint)
    • Line 69: warning: exported type TemplateFrontendTypeConfig should have comment or be unexported (golint)
    • rivine/persist/boltdb.go
    • Line 123: warning: exported method LazyBoltBucket.AsBoltBucket should have comment or be unexported (golint)
    • Line 127: warning: exported method LazyBoltBucket.Bucket should have comment or be unexported (golint)
    • Line 138: warning: exported method LazyBoltBucket.CreateBucket should have comment or be unexported (golint)
    • Line 145: warning: exported method LazyBoltBucket.CreateBucketIfNotExists should have comment or be unexported (golint)
    • Line 152: warning: exported method LazyBoltBucket.Cursor should have comment or be unexported (golint)
    • Line 159: warning: exported method LazyBoltBucket.Delete should have comment or be unexported (golint)
    • Line 166: warning: exported method LazyBoltBucket.DeleteBucket should have comment or be unexported (golint)
    • Line 173: warning: exported method LazyBoltBucket.ForEach should have comment or be unexported (golint)
    • Line 180: warning: exported method LazyBoltBucket.Get should have comment or be unexported (golint)
    • Line 187: warning: exported method LazyBoltBucket.NextSequence should have comment or be unexported (golint)
    • Line 194: warning: exported method LazyBoltBucket.Put should have comment or be unexported (golint)
    • Line 201: warning: exported method LazyBoltBucket.Root should have comment or be unexported (golint)
    • Line 208: warning: exported method LazyBoltBucket.Sequence should have comment or be unexported (golint)
    • Line 215: warning: exported method LazyBoltBucket.SetSequence should have comment or be unexported (golint)
    • Line 222: warning: exported method LazyBoltBucket.Stats should have comment or be unexported (golint)
    • Line 229: warning: exported method LazyBoltBucket.Tx should have comment or be unexported (golint)
    • Line 236: warning: exported method LazyBoltBucket.Writable should have comment or be unexported (golint)
    • rivine/caddy-plugin/proxy.go
    • Line 15: warning: package comment should be of the form "Package reb ..." (golint)
    • Line 420: warning: exported const CustomStatusContextCancelled should have comment or be unexported (golint)
    • rivine/types/transactions.go
    • Line 21: warning: exported const SpecifierLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: comment on exported type TransactionID should be of the form "TransactionID ..." (with optional leading article) (golint)
    • Line 70: warning: exported type CoinOutputID should have comment or be unexported (golint)
    • Line 71: warning: exported type BlockStakeOutputID should have comment or be unexported (golint)
    • Line 72: warning: exported type OutputID should have comment or be unexported (golint)
    • rivine/profile/profile.go
    • Line 27: warning: comment on exported function StartCPUProfile should be of the form "StartCPUProfile ..." (golint)
    • Line 50: warning: comment on exported function StopCPUProfile should be of the form "StopCPUProfile ..." (golint)
    • Line 60: warning: comment on exported function SaveMemProfile should be of the form "SaveMemProfile ..." (golint)
    • rivine/modules/consensus.go
    • Line 123: warning: comment on exported type PluginViewStorage should be of the form "PluginViewStorage ..." (with optional leading article) (golint)
    • rivine/pkg/client/baseclient.go
    • Line 13: warning: exported type BaseClient should have comment or be unexported (golint)
    • Line 19: warning: exported type LazyBaseClient should have comment or be unexported (golint)
    • Line 26: warning: exported type StdBaseClient should have comment or be unexported (golint)
    • Line 31: warning: exported type HTTPClient should have comment or be unexported (golint)
    • Line 44: warning: exported function NewLazyBaseClientFromCommandLineClient should have comment or be unexported (golint)
    • Line 52: warning: exported function NewLazyBaseClient should have comment or be unexported (golint)
    • Line 58: warning: exported method LazyBaseClient.Config should have comment or be unexported (golint)
    • Line 66: warning: exported method LazyBaseClient.HTTP should have comment or be unexported (golint)
    • Line 74: warning: exported method LazyBaseClient.NewCurrencyConvertor should have comment or be unexported (golint)
    • Line 86: warning: exported function NewBaseClientFromCommandLineClient should have comment or be unexported (golint)
    • Line 90: warning: exported function NewBaseClient should have comment or be unexported (golint)
    • Line 107: warning: exported method StdBaseClient.Config should have comment or be unexported (golint)
    • Line 111: warning: exported method StdBaseClient.HTTP should have comment or be unexported (golint)
    • rivine/types/block.go
    • Line 49: warning: comment on exported type BlockHeader should be of the form "BlockHeader ..." (with optional leading article) (golint)
    • Line 59: warning: exported type BlockHeight should have comment or be unexported (golint)
    • Line 60: warning: exported type BlockID should have comment or be unexported (golint)
    • Line 167: warning: comment on exported method Block.UnmarshalBlockHeadersParentIDAndTS should be of the form "UnmarshalBlockHeadersParentIDAndTS ..." (golint)
    • rivine/types/timestamp.go
    • Line 12: warning: exported type Timestamp should have comment or be unexported (golint)
    • Line 13: warning: exported type TimestampSlice should have comment or be unexported (golint)
    • Line 20: warning: exported method Timestamp.LoadString should have comment or be unexported (golint)
    • Line 25: warning: comment on exported function OffsetTimestamp should be of the form "OffsetTimestamp ..." (golint)
    • rivine/examples/rivchain/pkg/config/config.go
    • Line 36: warning: exported function GetDefaultGenesis should have comment or be unexported (golint)
    • Line 51: warning: exported function GetDevnetGenesis should have comment or be unexported (golint)
    • Line 118: warning: exported function GetDevnetBootstrapPeers should have comment or be unexported (golint)
    • Line 124: warning: exported function GetDevnetGenesisMintCondition should have comment or be unexported (golint)
    • Line 128: warning: exported function GetDevnetGenesisAuthCoinCondition should have comment or be unexported (golint)
    • Line 132: warning: exported function GetStandardGenesis should have comment or be unexported (golint)
    • Line 199: warning: exported function GetStandardBootstrapPeers should have comment or be unexported (golint)
    • Line 207: warning: exported function GetStandardGenesisMintCondition should have comment or be unexported (golint)
    • Line 211: warning: exported function GetStandardGenesisAuthCoinCondition should have comment or be unexported (golint)
    • Line 215: warning: exported function GetTestnetGenesis should have comment or be unexported (golint)
    • Line 286: warning: exported function GetTestnetBootstrapPeers should have comment or be unexported (golint)
    • Line 294: warning: exported function GetTestnetGenesisMintCondition should have comment or be unexported (golint)
    • Line 298: warning: exported function GetTestnetGenesisAuthCoinCondition should have comment or be unexported (golint)
    • rivine/examples/rivchain/pkg/config/daemon.go
    • Line 12: warning: exported function GetDevnetDaemonNetworkConfig should have comment or be unexported (golint)
    • Line 18: warning: exported function GetStandardDaemonNetworkConfig should have comment or be unexported (golint)
    • Line 24: warning: exported function GetTestnetDaemonNetworkConfig should have comment or be unexported (golint)
    • rivine/examples/rivchain/cmd/rivinec/transactions.go
    • Line 14: warning: exported function RegisterDevnetTransactions should have comment or be unexported (golint)
    • Line 18: warning: exported function RegisterStandardTransactions should have comment or be unexported (golint)
    • Line 22: warning: exported function RegisterTestnetTransactions should have comment or be unexported (golint)
    • rivine/cmd/rivinecg/pkg/config/config_file.go
    • Line 35: warning: exported type Config should have comment or be unexported (golint)
    • Line 42: warning: exported type Template should have comment or be unexported (golint)
    • Line 47: warning: exported type Frontend should have comment or be unexported (golint)
    • Line 52: warning: exported type Explorer should have comment or be unexported (golint)
    • Line 56: warning: exported type Faucet should have comment or be unexported (golint)
    • Line 60: warning: exported type Caddy should have comment or be unexported (golint)
    • Line 65: warning: exported type Generation should have comment or be unexported (golint)
    • Line 70: warning: exported type GlobPattern should have comment or be unexported (golint)
    • Line 75: warning: exported type Blockchain should have comment or be unexported (golint)
    • Line 87: warning: exported type Currency should have comment or be unexported (golint)
    • Line 92: warning: exported type Ports should have comment or be unexported (golint)
    • Line 97: warning: exported type Binaries should have comment or be unexported (golint)
    • Line 102: warning: exported type Transactions should have comment or be unexported (golint)
    • Line 108: warning: exported type Minting should have comment or be unexported (golint)
    • Line 115: warning: exported type Authcoin should have comment or be unexported (golint)
    • Line 120: warning: exported type Version should have comment or be unexported (golint)
    • Line 124: warning: exported type Genesis should have comment or be unexported (golint)
    • Line 132: warning: exported type Output should have comment or be unexported (golint)
    • Line 137: warning: exported type Condition should have comment or be unexported (golint)
    • Line 146: warning: exported type UnlockHash should have comment or be unexported (golint)
    • Line 150: warning: exported type Network should have comment or be unexported (golint)
    • Line 172: warning: exported type BootstrapPeer should have comment or be unexported (golint)
    • Line 181: warning: exported type TransactionPool should have comment or be unexported (golint)
    • Line 200: warning: exported method GlobPattern.MarshalText should have comment or be unexported (golint)
    • Line 207: warning: exported method GlobPattern.UnmarshalText should have comment or be unexported (golint)
    • Line 215: warning: exported method GlobPattern.Match should have comment or be unexported (golint)
    • Line 279: warning: exported function NewCondition should have comment or be unexported (golint)
    • Line 285: warning: exported function NewMultisigCondition should have comment or be unexported (golint)
    • Line 307: warning: exported method Condition.MarshalJSON should have comment or be unexported (golint)
    • Line 322: warning: exported method Condition.UnmarshalJSON should have comment or be unexported (golint)
    • Line 363: warning: exported method Condition.UnmarshalYAML should have comment or be unexported (golint)
    • Line 421: warning: exported type BlockchainGenerationOpts should have comment or be unexported (golint)
    • Line 598: warning: exported type ConfigGenerationOpts should have comment or be unexported (golint)
    • rivine/types/errors.go
    • Line 10: warning: exported type ClientErrorKind should have comment or be unexported (golint)
    • Line 13: warning: exported const ClientErrorBadRequest should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported method ClientErrorKind.AsHTTPStatusCode should have comment or be unexported (golint)
    • Line 61: warning: exported type ClientError should have comment or be unexported (golint)
    • Line 66: warning: exported function NewClientError should have comment or be unexported (golint)
    • rivine/types/target.go
    • Line 24: warning: exported var ErrNegativeTarget should have comment or be unexported (golint)
    • Line 86: warning: comment on exported method Target.MulDifficulty should be of the form "MulDifficulty ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words

    • rivine/cmd/rivinecg/pkg/config/generate_config_test.go
    • Line 29: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 34: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 39: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 46: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 50: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 63: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 68: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 73: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 79: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 84: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 92: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 96: warning: "occured" is a misspelling of "occurred" (misspell)