Preparing report...

Report for github.com/multiversx/mx-chain-go

(v1.4.0)

A+    Excellent!    Found 67 issues across 2490 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!


gofmt99%

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!


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.

    • process/sync/baseSync.go
    • Line 425: warning: cyclomatic complexity 22 of function checkBaseBootstrapParameters() is high (> 15) (gocyclo)
    • Line 719: warning: cyclomatic complexity 19 of function (*baseBootstrap).rollBack() is high (> 15) (gocyclo)
    • process/block/baseProcess.go
    • Line 416: warning: cyclomatic complexity 40 of function checkProcessorNilParameters() is high (> 15) (gocyclo)
    • Line 1710: warning: cyclomatic complexity 16 of function (*baseProcessor).commitTrieEpochRootHashIfNeeded() is high (> 15) (gocyclo)
    • process/scToProtocol/stakingToPeer.go
    • Line 270: warning: cyclomatic complexity 30 of function (*stakingToPeer).updatePeerState() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 19 of function (*stakingToPeer).updatePeerStateV1() is high (> 15) (gocyclo)
    • epochStart/metachain/systemSCs.go
    • Line 177: warning: cyclomatic complexity 25 of function (*systemSCProcessor).ProcessSystemSmartContract() is high (> 15) (gocyclo)
    • Line 736: warning: cyclomatic complexity 19 of function (*systemSCProcessor).stakingToValidatorStatistics() is high (> 15) (gocyclo)
    • Line 99: warning: cyclomatic complexity 16 of function NewSystemSCProcessor() is high (> 15) (gocyclo)
    • trie/sync.go
    • Line 168: warning: cyclomatic complexity 19 of function (*trieSyncer).checkIfSynced() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/delegation.go
    • Line 154: warning: cyclomatic complexity 50 of function (*delegation).Execute() is high (> 15) (gocyclo)
    • Line 1648: warning: cyclomatic complexity 24 of function (*delegation).unDelegate() is high (> 15) (gocyclo)
    • Line 2045: warning: cyclomatic complexity 22 of function (*delegation).withdraw() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 18 of function NewDelegationSystemSC() is high (> 15) (gocyclo)
    • Line 1451: warning: cyclomatic complexity 16 of function (*delegation).finishDelegateUser() is high (> 15) (gocyclo)
    • update/genesis/import.go
    • Line 304: warning: cyclomatic complexity 17 of function (*stateImport).importDataTrie() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 16 of function (*stateImport).importState() is high (> 15) (gocyclo)
    • factory/processing/blockProcessorCreator.go
    • Line 444: warning: cyclomatic complexity 37 of function (*processComponentsFactory).newMetaBlockProcessor() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 29 of function (*processComponentsFactory).newShardBlockProcessor() is high (> 15) (gocyclo)
    • process/smartContract/process.go
    • Line 843: warning: cyclomatic complexity 33 of function (*scProcessor).doExecuteBuiltInFunction() is high (> 15) (gocyclo)
    • Line 108: warning: cyclomatic complexity 23 of function NewSmartContractProcessor() is high (> 15) (gocyclo)
    • Line 2409: warning: cyclomatic complexity 22 of function (*scProcessor).processSCOutputAccounts() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 19 of function (*scProcessor).updateDeveloperRewardsV2() is high (> 15) (gocyclo)
    • Line 1302: warning: cyclomatic complexity 19 of function (*scProcessor).processIfErrorWithAddedLogs() is high (> 15) (gocyclo)
    • Line 1612: warning: cyclomatic complexity 18 of function (*scProcessor).doDeploySmartContract() is high (> 15) (gocyclo)
    • Line 2189: warning: cyclomatic complexity 17 of function (*scProcessor).createSmartContractResults() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/esdt.go
    • Line 118: warning: cyclomatic complexity 36 of function (*esdt).Execute() is high (> 15) (gocyclo)
    • Line 691: warning: cyclomatic complexity 21 of function (*esdt).upgradeProperties() is high (> 15) (gocyclo)
    • node/nodeRunner.go
    • Line 263: warning: cyclomatic complexity 25 of function (*nodeRunner).executeOneComponentCreationCycle() is high (> 15) (gocyclo)
    • process/transaction/shardProcess.go
    • Line 721: warning: cyclomatic complexity 20 of function (*txProcessor).processUserTx() is high (> 15) (gocyclo)
    • Line 144: warning: cyclomatic complexity 19 of function (*txProcessor).ProcessTransaction() is high (> 15) (gocyclo)
    • Line 70: warning: cyclomatic complexity 16 of function NewTxProcessor() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/staking.go
    • Line 135: warning: cyclomatic complexity 34 of function (*stakingSC).Execute() is high (> 15) (gocyclo)
    • Line 952: warning: cyclomatic complexity 22 of function (*stakingSC).removeFromWaitingList() is high (> 15) (gocyclo)
    • Line 587: warning: cyclomatic complexity 17 of function (*stakingSC).unStake() is high (> 15) (gocyclo)
    • process/block/shardblock.go
    • Line 161: warning: cyclomatic complexity 30 of function (*shardProcessor).ProcessBlock() is high (> 15) (gocyclo)
    • Line 428: warning: cyclomatic complexity 23 of function (*shardProcessor).checkEpochCorrectness() is high (> 15) (gocyclo)
    • Line 869: warning: cyclomatic complexity 21 of function (*shardProcessor).CommitBlock() is high (> 15) (gocyclo)
    • node/node.go
    • Line 730: warning: cyclomatic complexity 18 of function (*Node).CreateTransaction() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/validator.go
    • Line 164: warning: cyclomatic complexity 26 of function (*validatorSC).Execute() is high (> 15) (gocyclo)
    • Line 889: warning: cyclomatic complexity 25 of function (*validatorSC).stake() is high (> 15) (gocyclo)
    • Line 75: warning: cyclomatic complexity 25 of function NewValidatorSmartContract() is high (> 15) (gocyclo)
    • process/coordinator/process.go
    • Line 1710: warning: cyclomatic complexity 20 of function checkTransactionCoordinatorNilParameters() is high (> 15) (gocyclo)
    • Line 559: warning: cyclomatic complexity 18 of function (*transactionCoordinator).CreateMbsAndProcessCrossShardTransactionsDstMe() is high (> 15) (gocyclo)
    • process/block/metablock.go
    • Line 191: warning: cyclomatic complexity 33 of function (*metaProcessor).ProcessBlock() is high (> 15) (gocyclo)
    • Line 1145: warning: cyclomatic complexity 22 of function (*metaProcessor).CommitBlock() is high (> 15) (gocyclo)
    • Line 2087: warning: cyclomatic complexity 21 of function (*metaProcessor).applyBodyToHeader() is high (> 15) (gocyclo)
    • Line 409: warning: cyclomatic complexity 18 of function (*metaProcessor).processEpochStartMetaBlock() is high (> 15) (gocyclo)
    • Line 1706: warning: cyclomatic complexity 16 of function (*metaProcessor).checkShardHeadersValidity() is high (> 15) (gocyclo)
    • Line 52: warning: cyclomatic complexity 16 of function NewMetaProcessor() 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!