Preparing report...

Report for github.com/astra-net/astra-network

(v0.0.0-20220328212124-f37da11298df)

A+    Excellent!    Found 159 issues across 617 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!


gofmt82%

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.

    • astra/tracer.go
    • Line 106: warning: cyclomatic complexity 38 of function (*Astra).TraceChain() is high (> 15) (gocyclo)
    • Line 517: warning: cyclomatic complexity 20 of function (*Astra).standardTraceBlockToFile() is high (> 15) (gocyclo)
    • Line 415: warning: cyclomatic complexity 17 of function (*Astra).TraceBlock() is high (> 15) (gocyclo)
    • rpc/v2/types.go
    • Line 436: warning: cyclomatic complexity 20 of function NewStakingTransaction() is high (> 15) (gocyclo)
    • node/node.go
    • Line 611: warning: cyclomatic complexity 49 of function (*Node).StartPubSub() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 22 of function (*Node).validateShardBoundMessage() is high (> 15) (gocyclo)
    • Line 963: warning: cyclomatic complexity 21 of function New() is high (> 15) (gocyclo)
    • Line 397: warning: cyclomatic complexity 18 of function (*Node).validateNodeMessage() is high (> 15) (gocyclo)
    • core/blockchain.go
    • Line 1347: warning: cyclomatic complexity 32 of function (*BlockChain).insertChain() is high (> 15) (gocyclo)
    • Line 1181: warning: cyclomatic complexity 31 of function (*BlockChain).WriteBlockWithState() is high (> 15) (gocyclo)
    • Line 2455: warning: cyclomatic complexity 24 of function (*BlockChain).UpdateValidatorVotingPower() is high (> 15) (gocyclo)
    • Line 1060: warning: cyclomatic complexity 19 of function (*BlockChain).InsertReceiptChain() is high (> 15) (gocyclo)
    • Line 2821: warning: cyclomatic complexity 16 of function (*BlockChain).prepareStakingMetaData() is high (> 15) (gocyclo)
    • Line 949: warning: cyclomatic complexity 16 of function (*BlockChain).Rollback() is high (> 15) (gocyclo)
    • internal/chain/reward.go
    • Line 141: warning: cyclomatic complexity 26 of function AccumulateRewardsAndCountSigs() is high (> 15) (gocyclo)
    • Line 411: warning: cyclomatic complexity 24 of function distributeRewardBeforeAggregateEpoch() is high (> 15) (gocyclo)
    • Line 304: warning: cyclomatic complexity 16 of function distributeRewardAfterAggregateEpoch() is high (> 15) (gocyclo)
    • core/vm/evm.go
    • Line 497: warning: cyclomatic complexity 24 of function (*EVM).create() is high (> 15) (gocyclo)
    • Line 277: warning: cyclomatic complexity 23 of function (*EVM).Call() is high (> 15) (gocyclo)
    • Line 69: warning: cyclomatic complexity 19 of function run() 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)
    • 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)
    • core/staking_verifier.go
    • Line 219: warning: cyclomatic complexity 26 of function VerifyAndDelegateFromMsg() is high (> 15) (gocyclo)
    • Line 133: warning: cyclomatic complexity 20 of function VerifyAndEditValidatorFromMsg() is high (> 15) (gocyclo)
    • Line 404: warning: cyclomatic complexity 18 of function VerifyAndMigrateFromMsg() is high (> 15) (gocyclo)
    • rosetta/services/tx_operation_test.go
    • Line 807: warning: cyclomatic complexity 26 of function TestGetContractTransferNativeOperations() is high (> 15) (gocyclo)
    • Line 924: warning: cyclomatic complexity 26 of function TestGetContractCreationNativeOperations() 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)
    • rpc/v1/types.go
    • Line 399: warning: cyclomatic complexity 19 of function NewStakingTransaction() is high (> 15) (gocyclo)
    • consensus/construct_test.go
    • Line 215: warning: cyclomatic complexity 21 of function TestConstructCommitMessage() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 21 of function TestConstructPrepareMessage() is high (> 15) (gocyclo)
    • core/vm/logger.go
    • Line 150: warning: cyclomatic complexity 16 of function (*StructLogger).CaptureState() 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)
    • staking/types/validator.go
    • Line 585: warning: cyclomatic complexity 20 of function UpdateValidatorFromEditMsg() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 18 of function (*Validator).SanityCheck() 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)
    • 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/tx_pool.go
    • Line 1284: warning: cyclomatic complexity 43 of function (*TxPool).promoteExecutables() is high (> 15) (gocyclo)
    • Line 762: warning: cyclomatic complexity 30 of function (*TxPool).validateStakingTx() is high (> 15) (gocyclo)
    • Line 415: warning: cyclomatic complexity 22 of function (*TxPool).reset() is high (> 15) (gocyclo)
    • Line 680: warning: cyclomatic complexity 22 of function (*TxPool).validateTx() is high (> 15) (gocyclo)
    • Line 318: warning: cyclomatic complexity 19 of function (*TxPool).loop() 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)
    • core/offchain.go
    • Line 26: warning: cyclomatic complexity 44 of function (*BlockChain).CommitOffChainData() 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/tx_pool_test.go
    • Line 800: warning: cyclomatic complexity 30 of function TestTransactionPostponing() is high (> 15) (gocyclo)
    • Line 705: warning: cyclomatic complexity 19 of function TestTransactionDropping() is high (> 15) (gocyclo)
    • Line 1354: warning: cyclomatic complexity 19 of function testTransactionJournaling() 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)

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!