Preparing report...

Report for github.com/PositionExchange/posichain

(v0.0.12)

A+    Excellent!    Found 76 issues across 626 files

Tweet

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!


gofmt98%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo88%

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.

    • hmy/tracer.go
    • Line 106: warning: cyclomatic complexity 38 of function (*Harmony).TraceChain() is high (> 15) (gocyclo)
    • Line 518: warning: cyclomatic complexity 20 of function (*Harmony).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • Line 414: warning: cyclomatic complexity 19 of function (*Harmony).TraceBlock() is high (> 15) (gocyclo)
    • core/tx_pool_test.go
    • Line 800: warning: cyclomatic complexity 30 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 1354: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • Line 705: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • rosetta/services/tx_operation_test.go
    • Line 924: warning: cyclomatic complexity 26 of function TestGetContractCreationNativeOperations() is high (> 15) (gocyclo)
    • Line 807: warning: cyclomatic complexity 26 of function TestGetContractTransferNativeOperations() is high (> 15) (gocyclo)
    • Line 707: warning: cyclomatic complexity 24 of function TestGetContractInternalTransferNativeOperations() is high (> 15) (gocyclo)
    • Line 94: warning: cyclomatic complexity 21 of function TestGetSideEffectOperationsFromValueMap() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 283: warning: cyclomatic complexity 25 of function (*EVM).Call() is high (> 15) (gocyclo)
    • Line 505: warning: cyclomatic complexity 24 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 69: warning: cyclomatic complexity 21 of function run() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1300: warning: cyclomatic complexity 43 of function (*TxPool).promoteExecutables() is high (> 15) (gocyclo)
    • Line 777: warning: cyclomatic complexity 30 of function (*TxPool).validateStakingTx() is high (> 15) (gocyclo)
    • Line 685: warning: cyclomatic complexity 25 of function (*TxPool).validateTx() is high (> 15) (gocyclo)
    • Line 420: warning: cyclomatic complexity 22 of function (*TxPool).reset() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 20 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • internal/chain/reward.go
    • Line 387: warning: cyclomatic complexity 24 of function distributeRewardBeforeAggregateEpoch() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 16 of function distributeRewardAfterAggregateEpoch() is high (> 15) (gocyclo)
    • accounts/abi/bind/topics.go
    • Line 32: warning: cyclomatic complexity 20 of function makeTopics() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 18 of function parseTopics() is high (> 15) (gocyclo)
    • staking/types/validator.go
    • Line 616: warning: cyclomatic complexity 20 of function UpdateValidatorFromEditMsg() is high (> 15) (gocyclo)
    • Line 255: warning: cyclomatic complexity 18 of function (*Validator).SanityCheck() is high (> 15) (gocyclo)
    • rosetta/services/construction_check.go
    • Line 162: warning: cyclomatic complexity 27 of function (*ConstructAPI).ConstructionMetadata() is high (> 15) (gocyclo)
    • Line 50: warning: cyclomatic complexity 24 of function (*ConstructAPI).ConstructionPreprocess() is high (> 15) (gocyclo)
    • core/vm/logger.go
    • Line 150: warning: cyclomatic complexity 16 of function (*StructLogger).CaptureState() is high (> 15) (gocyclo)
    • core/staking_verifier.go
    • Line 220: warning: cyclomatic complexity 26 of function VerifyAndDelegateFromMsg() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 20 of function VerifyAndEditValidatorFromMsg() is high (> 15) (gocyclo)
    • Line 405: warning: cyclomatic complexity 18 of function VerifyAndMigrateFromMsg() is high (> 15) (gocyclo)
    • consensus/view_change_construct.go
    • Line 379: warning: cyclomatic complexity 25 of function (*viewChange).InitPayload() is high (> 15) (gocyclo)
    • Line 239: warning: cyclomatic complexity 23 of function (*viewChange).ProcessViewChangeMsg() is high (> 15) (gocyclo)
    • core/state/statedb_test.go
    • Line 160: warning: cyclomatic complexity 56 of function TestCopy() is high (> 15) (gocyclo)
    • Line 807: warning: cyclomatic complexity 21 of function TestCopyCopyCommitCopy() is high (> 15) (gocyclo)
    • Line 735: warning: cyclomatic complexity 17 of function TestCopyCommitCopy() is high (> 15) (gocyclo)
    • rpc/v2/types.go
    • Line 456: warning: cyclomatic complexity 28 of function NewStakingTransaction() is high (> 15) (gocyclo)
    • consensus/construct_test.go
    • Line 123: warning: cyclomatic complexity 21 of function TestConstructPrepareMessage() is high (> 15) (gocyclo)
    • Line 215: warning: cyclomatic complexity 21 of function TestConstructCommitMessage() is high (> 15) (gocyclo)
    • node/node.go
    • Line 614: warning: cyclomatic complexity 46 of function (*Node).StartPubSub() is high (> 15) (gocyclo)
    • Line 486: warning: cyclomatic complexity 22 of function (*Node).validateShardBoundMessage() is high (> 15) (gocyclo)
    • Line 954: warning: cyclomatic complexity 21 of function New() is high (> 15) (gocyclo)
    • Line 398: warning: cyclomatic complexity 19 of function (*Node).validateNodeMessage() is high (> 15) (gocyclo)
    • core/blockchain.go
    • Line 1348: warning: cyclomatic complexity 33 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 1185: warning: cyclomatic complexity 31 of function (*BlockChain).WriteBlockWithState() is high (> 15) (gocyclo)
    • Line 2477: warning: cyclomatic complexity 23 of function (*BlockChain).UpdateValidatorVotingPower() is high (> 15) (gocyclo)
    • Line 1064: warning: cyclomatic complexity 19 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 2834: warning: cyclomatic complexity 16 of function (*BlockChain).prepareStakingMetaData() is high (> 15) (gocyclo)
    • Line 953: warning: cyclomatic complexity 16 of function (*BlockChain).Rollback() is high (> 15) (gocyclo)
    • node/node_newblock.go
    • Line 126: warning: cyclomatic complexity 31 of function (*Node).ProposeNewBlock() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 17 of function (*Node).WaitForConsensusReadyV2() is high (> 15) (gocyclo)
    • rpc/v1/types.go
    • Line 420: warning: cyclomatic complexity 27 of function NewStakingTransaction() is high (> 15) (gocyclo)
    • core/offchain.go
    • Line 26: warning: cyclomatic complexity 44 of function (*BlockChain).CommitOffChainData() is high (> 15) (gocyclo)
    • rpc/filters/filter_system.go
    • Line 318: warning: cyclomatic complexity 23 of function (*EventSystem).broadcast() is high (> 15) (gocyclo)
    • Line 446: warning: cyclomatic complexity 17 of function (*EventSystem).eventLoop() is high (> 15) (gocyclo)
    • consensus/consensus_v2.go
    • Line 52: warning: cyclomatic complexity 32 of function (*Consensus).HandleMessageUpdate() is high (> 15) (gocyclo)
    • Line 291: warning: cyclomatic complexity 21 of function (*Consensus).Start() is high (> 15) (gocyclo)
    • rosetta/services/construction_create.go
    • Line 38: warning: cyclomatic complexity 26 of function unpackWrappedTransactionFromString() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 23 of function (*ConstructAPI).ConstructionCombine() is high (> 15) (gocyclo)
    • Line 264: warning: cyclomatic complexity 16 of function (*ConstructAPI).ConstructionPayloads() is high (> 15) (gocyclo)

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!