Preparing report...

Report for github.com/nknorg/nkn

(v1.1.7-beta)

A+    Excellent!    Found 37 issues across 148 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!


gofmt91%

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!


gocyclo82%

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.

    • chain/trie/pruning.go
    • Line 171: warning: cyclomatic complexity 27 of function (*RefCounts).prune() is high (> 15) (gocyclo)
    • Line 75: warning: cyclomatic complexity 23 of function (*RefCounts).createRefCounts() is high (> 15) (gocyclo)
    • chain/store/statedb.go
    • Line 181: warning: cyclomatic complexity 24 of function (*StateDB).PruneStatesLowMemory() is high (> 15) (gocyclo)
    • Line 95: warning: cyclomatic complexity 18 of function (*StateDB).PruneStates() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 16 of function (*StateDB).SequentialPrune() is high (> 15) (gocyclo)
    • chain/pool/txpool.go
    • Line 107: warning: cyclomatic complexity 20 of function (*TxnPool).DropTxns() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 19 of function (*TxnPool).processTx() is high (> 15) (gocyclo)
    • consensus/proposal.go
    • Line 303: warning: cyclomatic complexity 39 of function (*Consensus).requestProposal() is high (> 15) (gocyclo)
    • Line 54: warning: cyclomatic complexity 24 of function (*Consensus).waitAndHandleProposal() is high (> 15) (gocyclo)
    • chain/blockValidator.go
    • Line 52: warning: cyclomatic complexity 31 of function TransactionCheck() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 22 of function GetNextBlockSigner() is high (> 15) (gocyclo)
    • chain/trie/trie.go
    • Line 195: warning: cyclomatic complexity 20 of function (*Trie).delete() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 16 of function (*Trie).traverse() is high (> 15) (gocyclo)
    • pb/sigchain.go
    • Line 161: warning: cyclomatic complexity 19 of function (*SigChain).VerifyMeta() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 16 of function (*SigChain).VerifySignatures() is high (> 15) (gocyclo)
    • consensus/message.go
    • Line 312: warning: cyclomatic complexity 17 of function (*Consensus).requestProposalTransactionsMessageHandler() is high (> 15) (gocyclo)
    • chain/store/stateGenerator.go
    • Line 18: warning: cyclomatic complexity 49 of function (*ChainStore).spendTransaction() is high (> 15) (gocyclo)
    • Line 193: warning: cyclomatic complexity 32 of function (*ChainStore).generateStateRoot() is high (> 15) (gocyclo)
    • chain/mining.go
    • Line 56: warning: cyclomatic complexity 21 of function (*BuiltinMining).BuildBlock() is high (> 15) (gocyclo)
    • chain/txValidator.go
    • Line 283: warning: cyclomatic complexity 55 of function VerifyTransactionWithLedger() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 52 of function CheckTransactionPayload() is high (> 15) (gocyclo)
    • Line 584: warning: cyclomatic complexity 46 of function (*BlockValidationState).VerifyTransactionWithBlock() is high (> 15) (gocyclo)
    • Line 805: warning: cyclomatic complexity 22 of function (*BlockValidationState).CleanSubmittedTransactions() is high (> 15) (gocyclo)
    • node/message.go
    • Line 76: warning: cyclomatic complexity 39 of function (*LocalNode).remoteMessageRouted() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words