Preparing report...

Report for github.com/harmony-one/harmony

(v1.10.2)

A+    Excellent!    Found 94 issues across 474 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!


gofmt90%

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.

    • node/node.go
    • Line 552: warning: cyclomatic complexity 39 of function (*Node).Start() is high (> 15) (gocyclo)
    • Line 432: warning: cyclomatic complexity 20 of function (*Node).validateShardBoundMessage() is high (> 15) (gocyclo)
    • Line 874: warning: cyclomatic complexity 18 of function New() 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)
    • rosetta/services/construction_check.go
    • Line 145: warning: cyclomatic complexity 27 of function (*ConstructAPI).ConstructionMetadata() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 16 of function (*ConstructAPI).ConstructionPreprocess() is high (> 15) (gocyclo)
    • core/staking_verifier.go
    • Line 202: warning: cyclomatic complexity 24 of function VerifyAndDelegateFromMsg() is high (> 15) (gocyclo)
    • Line 128: warning: cyclomatic complexity 16 of function VerifyAndEditValidatorFromMsg() is high (> 15) (gocyclo)
    • core/tx_pool.go
    • Line 1278: warning: cyclomatic complexity 42 of function (*TxPool).promoteExecutables() is high (> 15) (gocyclo)
    • Line 765: warning: cyclomatic complexity 28 of function (*TxPool).validateStakingTx() is high (> 15) (gocyclo)
    • Line 677: warning: cyclomatic complexity 25 of function (*TxPool).validateTx() is high (> 15) (gocyclo)
    • Line 412: warning: cyclomatic complexity 22 of function (*TxPool).reset() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 20 of function (*TxPool).loop() is high (> 15) (gocyclo)
    • core/tx_pool_test.go
    • Line 799: warning: cyclomatic complexity 28 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 704: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 1349: warning: cyclomatic complexity 19 of function testTransactionJournaling() is high (> 15) (gocyclo)
    • rpc/v2/types.go
    • Line 417: warning: cyclomatic complexity 27 of function NewStakingTransaction() is high (> 15) (gocyclo)
    • consensus/construct_test.go
    • Line 117: warning: cyclomatic complexity 21 of function TestConstructPrepareMessage() is high (> 15) (gocyclo)
    • Line 206: warning: cyclomatic complexity 21 of function TestConstructCommitMessage() is high (> 15) (gocyclo)
    • core/blockchain.go
    • Line 1290: warning: cyclomatic complexity 32 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 1140: warning: cyclomatic complexity 27 of function (*BlockChain).WriteBlockWithState() is high (> 15) (gocyclo)
    • Line 2350: warning: cyclomatic complexity 24 of function (*BlockChain).UpdateValidatorVotingPower() is high (> 15) (gocyclo)
    • Line 1020: warning: cyclomatic complexity 19 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 911: warning: cyclomatic complexity 16 of function (*BlockChain).Rollback() is high (> 15) (gocyclo)
    • rosetta/services/tx_operation_test.go
    • Line 900: warning: cyclomatic complexity 26 of function TestGetContractCreationNativeOperations() is high (> 15) (gocyclo)
    • Line 783: warning: cyclomatic complexity 25 of function TestGetContractTransferNativeOperations() is high (> 15) (gocyclo)
    • Line 683: warning: cyclomatic complexity 23 of function TestGetContractInternalTransferNativeOperations() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 21 of function TestGetSideEffectOperationsFromValueMap() is high (> 15) (gocyclo)
    • core/offchain.go
    • Line 26: warning: cyclomatic complexity 45 of function (*BlockChain).CommitOffChainData() is high (> 15) (gocyclo)
    • consensus/consensus_v2.go
    • Line 275: warning: cyclomatic complexity 30 of function (*Consensus).Start() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 29 of function (*Consensus).HandleMessageUpdate() is high (> 15) (gocyclo)
    • rosetta/services/construction_create.go
    • Line 182: warning: cyclomatic complexity 23 of function (*ConstructAPI).ConstructionCombine() is high (> 15) (gocyclo)
    • Line 77: warning: cyclomatic complexity 16 of function (*ConstructAPI).ConstructionPayloads() is high (> 15) (gocyclo)
    • core/state/statedb_test.go
    • Line 569: warning: cyclomatic complexity 21 of function TestCopyCopyCommitCopy() is high (> 15) (gocyclo)
    • Line 497: warning: cyclomatic complexity 17 of function TestCopyCommitCopy() is high (> 15) (gocyclo)
    • staking/types/validator.go
    • Line 586: warning: cyclomatic complexity 20 of function UpdateValidatorFromEditMsg() is high (> 15) (gocyclo)
    • Line 253: warning: cyclomatic complexity 18 of function (*Validator).SanityCheck() is high (> 15) (gocyclo)
    • rpc/filters/filter_system.go
    • Line 316: warning: cyclomatic complexity 23 of function (*EventSystem).broadcast() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 17 of function (*EventSystem).eventLoop() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 407: warning: cyclomatic complexity 24 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 19 of function (*EVM).Call() is high (> 15) (gocyclo)
    • hmy/tracer.go
    • Line 104: warning: cyclomatic complexity 38 of function (*Harmony).TraceChain() is high (> 15) (gocyclo)
    • Line 438: warning: cyclomatic complexity 20 of function (*Harmony).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • rpc/v1/types.go
    • Line 412: warning: cyclomatic complexity 27 of function NewStakingTransaction() 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!