Preparing report...

Report for github.com/filecoin-project/venus

(v1.7.1)

A+    Excellent!    Found 53 issues across 782 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!


gocyclo93%

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.

    • pkg/fork/fork.go
    • Line 684: warning: cyclomatic complexity 45 of function (*ChainFork).UpgradeFaucetBurnRecovery() is high (> 15) (gocyclo)
    • Line 2168: warning: cyclomatic complexity 21 of function LiteMigration() is high (> 15) (gocyclo)
    • Line 1061: warning: cyclomatic complexity 17 of function splitGenesisMultisig0() is high (> 15) (gocyclo)
    • Line 312: warning: cyclomatic complexity 16 of function (UpgradeSchedule).Validate() is high (> 15) (gocyclo)
    • pkg/chain/store.go
    • Line 806: warning: cyclomatic complexity 26 of function (*Store).WalkSnapshot() is high (> 15) (gocyclo)
    • Line 1017: warning: cyclomatic complexity 24 of function (*Store).getCirculatingSupply() is high (> 15) (gocyclo)
    • app/submodule/chain/miner_api.go
    • Line 945: warning: cyclomatic complexity 21 of function (*minerStateAPI).StateListMessages() is high (> 15) (gocyclo)
    • Line 441: warning: cyclomatic complexity 18 of function (*minerStateAPI).StateMinerInitialPledgeCollateral() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 16 of function (*minerStateAPI).StateMinerPreCommitDepositForPower() is high (> 15) (gocyclo)
    • tools/gengen/util/generator.go
    • Line 378: warning: cyclomatic complexity 21 of function (*GenesisGenerator).setupMiners() is high (> 15) (gocyclo)
    • Line 195: warning: cyclomatic complexity 18 of function (*GenesisGenerator).setupBuiltInActors() is high (> 15) (gocyclo)
    • pkg/chain/waiter.go
    • Line 172: warning: cyclomatic complexity 26 of function (*Waiter).waitForMessage() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 18 of function (*Waiter).findMessage() is high (> 15) (gocyclo)
    • pkg/statemanger/call.go
    • Line 31: warning: cyclomatic complexity 21 of function (*Stmgr).CallWithGas() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 18 of function (*Stmgr).Call() is high (> 15) (gocyclo)
    • pkg/messagepool/selection_test.go
    • Line 79: warning: cyclomatic complexity 50 of function TestMessageChains() is high (> 15) (gocyclo)
    • Line 1434: warning: cyclomatic complexity 30 of function TestRealWorldSelection() is high (> 15) (gocyclo)
    • Line 375: warning: cyclomatic complexity 24 of function TestBasicMessageSelection() is high (> 15) (gocyclo)
    • Line 1183: warning: cyclomatic complexity 18 of function testCompetitiveMessageSelection() is high (> 15) (gocyclo)
    • cmd/daemon.go
    • Line 165: warning: cyclomatic complexity 25 of function daemonRun() is high (> 15) (gocyclo)
    • pkg/consensus/block_validator.go
    • Line 143: warning: cyclomatic complexity 30 of function (*BlockValidator).validateBlock() is high (> 15) (gocyclo)
    • Line 747: warning: cyclomatic complexity 25 of function (*BlockValidator).checkBlockMessages() is high (> 15) (gocyclo)
    • Line 573: warning: cyclomatic complexity 18 of function (*BlockValidator).MinerEligibleToMine() is high (> 15) (gocyclo)
    • pkg/state/view.go
    • Line 145: warning: cyclomatic complexity 18 of function (*View).GetSectorsForWinningPoSt() is high (> 15) (gocyclo)
    • pkg/fvm/fvm.go
    • Line 92: warning: cyclomatic complexity 18 of function (*FvmExtern).VerifyConsensusFault() is high (> 15) (gocyclo)
    • pkg/messagepool/messagepool.go
    • Line 1222: warning: cyclomatic complexity 33 of function (*MessagePool).HeadChange() is high (> 15) (gocyclo)
    • Line 231: warning: cyclomatic complexity 17 of function (*msgSet).add() is high (> 15) (gocyclo)
    • app/submodule/mining/mining_api.go
    • Line 36: warning: cyclomatic complexity 21 of function (*MiningAPI).MinerGetBaseInfo() is high (> 15) (gocyclo)
    • Line 168: warning: cyclomatic complexity 17 of function (*MiningAPI).minerCreateBlock() is high (> 15) (gocyclo)
    • pkg/paychmgr/paych.go
    • Line 182: warning: cyclomatic complexity 20 of function (*channelAccessor).checkVoucherValidUnlocked() is high (> 15) (gocyclo)
    • pkg/messagepool/selection.go
    • Line 205: warning: cyclomatic complexity 50 of function (*MessagePool).selectMessagesOptimal() is high (> 15) (gocyclo)
    • Line 446: warning: cyclomatic complexity 23 of function (*MessagePool).selectMessagesGreedy() is high (> 15) (gocyclo)
    • Line 753: warning: cyclomatic complexity 22 of function (*MessagePool).createMessageChains() is high (> 15) (gocyclo)
    • Line 573: warning: cyclomatic complexity 20 of function (*MessagePool).selectPriorityMessages() is high (> 15) (gocyclo)
    • pkg/messagepool/gas.go
    • Line 222: warning: cyclomatic complexity 24 of function (*MessagePool).evalMessageGasLimit() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 16 of function (*MessagePool).GasBatchEstimateMessageGas() is high (> 15) (gocyclo)
    • pkg/vm/vmcontext/vmcontext.go
    • Line 503: warning: cyclomatic complexity 22 of function (*LegacyVM).transfer() is high (> 15) (gocyclo)
    • Line 258: warning: cyclomatic complexity 20 of function (*LegacyVM).applyMessage() 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!