Preparing report...

Report for github.com/TerraDharitri/drt-go-chain

(v0.0.0-20250303161849-2ba264e57106)

A+    Excellent!    Found 89 issues across 2837 files

Tweet

gofmt99%

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!


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 430: warning: cyclomatic complexity 22 of function checkBaseBootstrapParameters() is high (> 15) (gocyclo)
    • Line 719: warning: cyclomatic complexity 20 of function (*baseBootstrap).rollBack() is high (> 15) (gocyclo)
    • consensus/spos/worker.go
    • Line 187: warning: cyclomatic complexity 25 of function checkNewWorkerParams() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 17 of function (*Worker).ProcessReceivedMessage() is high (> 15) (gocyclo)
    • node/node.go
    • Line 839: warning: cyclomatic complexity 23 of function (*Node).CreateTransaction() is high (> 15) (gocyclo)
    • trie/sync.go
    • Line 171: warning: cyclomatic complexity 19 of function (*trieSyncer).checkIfSynced() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/validator.go
    • Line 81: warning: cyclomatic complexity 30 of function NewValidatorSmartContract() is high (> 15) (gocyclo)
    • Line 953: warning: cyclomatic complexity 26 of function (*validatorSC).stake() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 26 of function (*validatorSC).Execute() is high (> 15) (gocyclo)
    • process/coordinator/process.go
    • Line 1762: warning: cyclomatic complexity 22 of function checkTransactionCoordinatorNilParameters() is high (> 15) (gocyclo)
    • Line 563: warning: cyclomatic complexity 18 of function (*transactionCoordinator).CreateMbsAndProcessCrossShardTransactionsDstMe() is high (> 15) (gocyclo)
    • update/genesis/import.go
    • Line 452: warning: cyclomatic complexity 17 of function (*stateImport).importState() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 17 of function (*stateImport).importDataTrie() is high (> 15) (gocyclo)
    • epochStart/metachain/legacySystemSCs.go
    • Line 135: warning: cyclomatic complexity 28 of function (*legacySystemSCProcessor).processLegacy() is high (> 15) (gocyclo)
    • Line 687: warning: cyclomatic complexity 18 of function (*legacySystemSCProcessor).stakingToValidatorStatistics() is high (> 15) (gocyclo)
    • Line 85: warning: cyclomatic complexity 16 of function checkLegacyArgs() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/dcdt.go
    • Line 137: warning: cyclomatic complexity 40 of function (*dcdt).Execute() is high (> 15) (gocyclo)
    • Line 778: warning: cyclomatic complexity 23 of function (*dcdt).upgradeProperties() is high (> 15) (gocyclo)
    • vm/systemSmartContracts/delegation.go
    • Line 172: warning: cyclomatic complexity 51 of function (*delegation).Execute() is high (> 15) (gocyclo)
    • Line 2137: warning: cyclomatic complexity 22 of function (*delegation).withdraw() is high (> 15) (gocyclo)
    • Line 1744: warning: cyclomatic complexity 19 of function (*delegation).unDelegateValueFromAddress() is high (> 15) (gocyclo)
    • Line 86: warning: cyclomatic complexity 19 of function NewDelegationSystemSC() is high (> 15) (gocyclo)
    • process/scToProtocol/stakingToPeer.go
    • Line 268: warning: cyclomatic complexity 31 of function (*stakingToPeer).updatePeerState() is high (> 15) (gocyclo)
    • Line 212: warning: cyclomatic complexity 17 of function (*stakingToPeer).updatePeerStateV1() is high (> 15) (gocyclo)
    • process/smartContract/processorV2/processV2.go
    • Line 904: warning: cyclomatic complexity 24 of function (*scProcessor).doExecuteBuiltInFunctionWithoutFailureProcessing() is high (> 15) (gocyclo)
    • Line 118: warning: cyclomatic complexity 24 of function NewSmartContractProcessorV2() is high (> 15) (gocyclo)
    • Line 556: warning: cyclomatic complexity 16 of function (*scProcessor).updateDeveloperRewards() is high (> 15) (gocyclo)
    • Line 1767: warning: cyclomatic complexity 16 of function (*scProcessor).doDeploySmartContract() is high (> 15) (gocyclo)
    • Line 1447: warning: cyclomatic complexity 16 of function (*scProcessor).processIfErrorWithAddedLogs() is high (> 15) (gocyclo)
    • process/transaction/shardProcess.go
    • Line 75: warning: cyclomatic complexity 21 of function NewTxProcessor() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 20 of function (*txProcessor).processUserTx() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 19 of function (*txProcessor).ProcessTransaction() is high (> 15) (gocyclo)
    • Line 459: warning: cyclomatic complexity 17 of function (*txProcessor).processMoveBalance() is high (> 15) (gocyclo)
    • process/block/preprocess/smartContractResults.go
    • Line 37: warning: cyclomatic complexity 18 of function NewSmartContractResultPreprocessor() is high (> 15) (gocyclo)
    • Line 540: warning: cyclomatic complexity 17 of function (*smartContractResults).ProcessMiniBlock() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 17 of function (*smartContractResults).ProcessBlockTransactions() is high (> 15) (gocyclo)
    • process/block/baseProcess.go
    • Line 430: warning: cyclomatic complexity 45 of function checkProcessorParameters() is high (> 15) (gocyclo)
    • Line 1731: warning: cyclomatic complexity 17 of function (*baseProcessor).commitTrieEpochRootHashIfNeeded() is high (> 15) (gocyclo)
    • process/block/shardblock.go
    • Line 160: warning: cyclomatic complexity 31 of function (*shardProcessor).ProcessBlock() is high (> 15) (gocyclo)
    • Line 432: warning: cyclomatic complexity 23 of function (*shardProcessor).checkEpochCorrectness() is high (> 15) (gocyclo)
    • Line 894: warning: cyclomatic complexity 22 of function (*shardProcessor).CommitBlock() is high (> 15) (gocyclo)
    • node/nodeRunner.go
    • Line 271: warning: cyclomatic complexity 27 of function (*nodeRunner).executeOneComponentCreationCycle() is high (> 15) (gocyclo)
    • process/smartContract/process.go
    • Line 925: warning: cyclomatic complexity 35 of function (*scProcessor).doExecuteBuiltInFunction() is high (> 15) (gocyclo)
    • Line 115: warning: cyclomatic complexity 25 of function NewSmartContractProcessor() is high (> 15) (gocyclo)
    • Line 2533: warning: cyclomatic complexity 23 of function (*scProcessor).processSCOutputAccounts() is high (> 15) (gocyclo)
    • Line 1400: warning: cyclomatic complexity 21 of function (*scProcessor).processIfErrorWithAddedLogs() is high (> 15) (gocyclo)
    • Line 1716: warning: cyclomatic complexity 20 of function (*scProcessor).doDeploySmartContract() is high (> 15) (gocyclo)
    • Line 2306: warning: cyclomatic complexity 20 of function (*scProcessor).createSmartContractResults() is high (> 15) (gocyclo)
    • Line 565: warning: cyclomatic complexity 19 of function (*scProcessor).updateDeveloperRewardsV2() is high (> 15) (gocyclo)
    • process/block/metablock.go
    • Line 190: warning: cyclomatic complexity 34 of function (*metaProcessor).ProcessBlock() is high (> 15) (gocyclo)
    • Line 1161: warning: cyclomatic complexity 23 of function (*metaProcessor).CommitBlock() is high (> 15) (gocyclo)
    • Line 2134: warning: cyclomatic complexity 21 of function (*metaProcessor).applyBodyToHeader() is high (> 15) (gocyclo)
    • Line 413: warning: cyclomatic complexity 18 of function (*metaProcessor).processEpochStartMetaBlock() is high (> 15) (gocyclo)
    • Line 1734: warning: cyclomatic complexity 16 of function (*metaProcessor).checkShardHeadersValidity() is high (> 15) (gocyclo)
    • factory/processing/blockProcessorCreator.go
    • Line 471: warning: cyclomatic complexity 41 of function (*processComponentsFactory).newMetaBlockProcessor() is high (> 15) (gocyclo)
    • Line 116: warning: cyclomatic complexity 28 of function (*processComponentsFactory).newShardBlockProcessor() 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!