Preparing report...

Report for github.com/MDLLife/MDL

A+    Excellent!    Found 74 issues across 309 files

Tweet

gofmt95%

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!


golint97%

Golint is a linter for Go source code.

    • MDL/src/consensus/connection_manager.go
    • Line 1: warning: package comment should be of the form "Package consensus ..." (golint)
    • Line 9: warning: comment on exported type ConnectionManagerInterface should be of the form "ConnectionManagerInterface ..." (with optional leading article) (golint)
    • MDL/src/consensus/consensus.go
    • Line 1: warning: package comment should be of the form "Package consensus ..." (golint)
    • Line 13: warning: comment on exported var Cfg_debug_block_duplicate should be of the form "Cfg_debug_block_duplicate ..." (golint)
    • Line 18: warning: don't use underscores in Go names; var Cfg_debug_block_duplicate should be CfgDebugBlockDuplicate (golint)
    • Line 19: warning: don't use underscores in Go names; var Cfg_debug_block_out_of_sequence should be CfgDebugBlockOutOfSequence (golint)
    • Line 19: warning: exported var Cfg_debug_block_out_of_sequence should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; var Cfg_debug_block_accepted should be CfgDebugBlockAccepted (golint)
    • Line 20: warning: exported var Cfg_debug_block_accepted should have comment or be unexported (golint)
    • Line 21: warning: don't use underscores in Go names; var Cfg_debug_HashCandidate should be CfgDebugHashCandidate (golint)
    • Line 21: warning: exported var Cfg_debug_HashCandidate should have comment or be unexported (golint)
    • Line 23: warning: comment on exported var Cfg_blockchain_tail_length should be of the form "Cfg_blockchain_tail_length ..." (golint)
    • Line 25: warning: don't use underscores in Go names; var Cfg_blockchain_tail_length should be CfgBlockchainTailLength (golint)
    • Line 27: warning: comment on exported var Cfg_consensus_candidate_max_seqno_gap should be of the form "Cfg_consensus_candidate_max_seqno_gap ..." (golint)
    • Line 28: warning: don't use underscores in Go names; var Cfg_consensus_candidate_max_seqno_gap should be CfgConsensusCandidateMaxSeqnoGap (golint)
    • Line 30: warning: comment on exported var Cfg_consensus_waiting_time_as_seqno_diff should be of the form "Cfg_consensus_waiting_time_as_seqno_diff ..." (golint)
    • Line 32: warning: don't use underscores in Go names; var Cfg_consensus_waiting_time_as_seqno_diff should be CfgConsensusWaitingTimeAsSeqnoDiff (golint)
    • Line 44: warning: comment on exported type BlockBase should be of the form "BlockBase ..." (with optional leading article) (golint)
    • Line 59: warning: comment on exported method BlockBase.Init should be of the form "Init ..." (golint)
    • Line 60: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 70: warning: comment on exported method BlockBase.Print should be of the form "Print ..." (golint)
    • Line 71: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 77: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 82: warning: comment on exported type BlockchainTail should be of the form "BlockchainTail ..." (with optional leading article) (golint)
    • Line 91: warning: don't use underscores in Go names; struct field blockPtr_slice should be blockPtrSlice (golint)
    • Line 93: warning: don't use underscores in Go names; struct field hash_to_blockPtr_map should be hashToBlockPtrMap (golint)
    • Line 96: warning: comment on exported method BlockchainTail.Init should be of the form "Init ..." (golint)
    • Line 97: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 102: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 102: warning: don't use underscores in Go names; method is_consistent should be isConsistent (golint)
    • Line 112: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 112: warning: don't use underscores in Go names; method append_nocheck should be appendNocheck (golint)
    • Line 128: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 128: warning: don't use underscores in Go names; method try_append_to_BlockchainTail should be tryAppendToBlockchainTail (golint)
    • Line 167: warning: comment on exported method BlockchainTail.GetNextSeqNo should be of the form "GetNextSeqNo ..." (golint)
    • Line 168: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 176: warning: comment on exported method BlockchainTail.Print should be of the form "Print ..." (golint)
    • Line 177: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 188: warning: comment on exported type HashCandidate should be of the form "HashCandidate ..." (with optional leading article) (golint)
    • Line 198: warning: comment on exported method HashCandidate.Init should be of the form "Init ..." (golint)
    • Line 199: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 204: warning: comment on exported method HashCandidate.ObserveSigAndPubkey should be of the form "ObserveSigAndPubkey ..." (golint)
    • Line 205: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 231: warning: comment on exported method HashCandidate.Clear should be of the form "Clear ..." (golint)
    • Line 232: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 242: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 242: warning: don't use underscores in Go names; method is_consistent should be isConsistent (golint)
    • MDL/src/consensus/participant.go
    • Line 1: warning: package comment should be of the form "Package consensus ..." (golint)
    • Line 13: warning: comment on exported type ConsensusParticipant should be of the form "ConsensusParticipant ..." (with optional leading article) (golint)
    • Line 27: warning: don't use underscores in Go names; struct field block_queue should be blockQueue (golint)
    • Line 30: warning: don't use underscores in Go names; struct field block_stat_queue should be blockStatQueue (golint)
    • Line 32: warning: don't use underscores in Go names; struct field Incoming_block_count should be IncomingBlockCount (golint)
    • Line 35: warning: exported method ConsensusParticipant.GetConnectionManager should have comment or be unexported (golint)
    • Line 35: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 39: warning: comment on exported method ConsensusParticipant.GetNextBlockSeqNo should be of the form "GetNextBlockSeqNo ..." (golint)
    • Line 40: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 44: warning: comment on exported method ConsensusParticipant.SetPubkeySeckey should be of the form "SetPubkeySeckey ..." (golint)
    • Line 45: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 53: warning: comment on exported method ConsensusParticipant.Print should be of the form "Print ..." (golint)
    • Line 54: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 71: warning: comment on exported function NewConsensusParticipantPtr should be of the form "NewConsensusParticipantPtr ..." (golint)
    • Line 91: warning: comment on exported method ConsensusParticipant.SignatureOf should be of the form "SignatureOf ..." (golint)
    • Line 96: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 103: warning: comment on exported method ConsensusParticipant.Get_block_stat_queue_Len should be of the form "Get_block_stat_queue_Len ..." (golint)
    • Line 104: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 104: warning: don't use underscores in Go names; method Get_block_stat_queue_Len should be GetBlockStatQueueLen (golint)
    • Line 108: warning: comment on exported method ConsensusParticipant.Get_block_stat_queue_element_at should be of the form "Get_block_stat_queue_element_at ..." (golint)
    • Line 109: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 109: warning: don't use underscores in Go names; method Get_block_stat_queue_element_at should be GetBlockStatQueueElementAt (golint)
    • Line 115: warning: comment on exported method ConsensusParticipant.OnBlockHeaderArrived should be of the form "OnBlockHeaderArrived ..." (golint)
    • Line 116: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 128: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 128: warning: don't use underscores in Go names; method harvest_ripe_BlockStat should be harvestRipeBlockStat (golint)
    • Line 138: warning: don't use underscores in Go names; var top_seqno should be topSeqno (golint)
    • MDL/src/consensus/blockstat.go
    • Line 1: warning: package comment should be of the form "Package consensus ..." (golint)
    • Line 16: warning: comment on exported var Cfg_consensus_max_candidate_messages should be of the form "Cfg_consensus_max_candidate_messages ..." (golint)
    • Line 24: warning: don't use underscores in Go names; var Cfg_consensus_max_candidate_messages should be CfgConsensusMaxCandidateMessages (golint)
    • Line 28: warning: don't use underscores in Go names; var all_zero_hash should be allZeroHash (golint)
    • Line 29: warning: don't use underscores in Go names; var all_zero_sig should be allZeroSig (golint)
    • Line 31: warning: comment on exported type BlockStat should be of the form "BlockStat ..." (with optional leading article) (golint)
    • Line 104: warning: don't use underscores in Go names; struct field accept_count should be acceptCount (golint)
    • Line 109: warning: don't use underscores in Go names; struct field debug_pubkey2count should be debugPubkey2count (golint)
    • Line 110: warning: don't use underscores in Go names; struct field debug_count should be debugCount (golint)
    • Line 114: warning: don't use underscores in Go names; struct field debug_reject_count should be debugRejectCount (golint)
    • Line 117: warning: don't use underscores in Go names; struct field debug_neglect_count should be debugNeglectCount (golint)
    • Line 119: warning: don't use underscores in Go names; struct field debug_usage should be debugUsage (golint)
    • Line 126: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 126: warning: don't use underscores in Go names; method is_consistent should be isConsistent (golint)
    • Line 139: warning: comment on exported method BlockStat.Init should be of the form "Init ..." (golint)
    • Line 140: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 156: warning: comment on exported method BlockStat.GetSeqno should be of the form "GetSeqno ..." (golint)
    • Line 157: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 161: warning: comment on exported method BlockStat.Clear should be of the form "Clear ..." (golint)
    • Line 162: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 181: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 181: warning: don't use underscores in Go names; method try_add_hash_and_sig should be tryAddHashAndSig (golint)
    • Line 216: warning: don't use underscores in Go names; var action_update should be actionUpdate (golint)
    • Line 217: warning: don't use underscores in Go names; var action_skip should be actionSkip (golint)
    • Line 218: warning: don't use underscores in Go names; var action_insert should be actionInsert (golint)
    • Line 247: warning: don't use underscores in Go names; var signer_pubkey should be signerPubkey (golint)
    • Line 309: warning: comment on exported method BlockStat.GetBestHashPubkeySig should be of the form "GetBestHashPubkeySig ..." (golint)
    • Line 310: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 315: warning: don't use underscores in Go names; var best_n should be bestN (golint)
    • Line 317: warning: don't use underscores in Go names; var best_h should be bestH (golint)
    • Line 340: warning: don't use underscores in Go names; var best_p should be bestP (golint)
    • Line 341: warning: don't use underscores in Go names; var best_s should be bestS (golint)
    • Line 375: warning: comment on exported method BlockStat.Print should be of the form "Print ..." (golint)
    • Line 376: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 394: warning: comment on exported type PriorityQueue should be of the form "PriorityQueue ..." (with optional leading article) (golint)
    • Line 413: warning: exported method PriorityQueue.Push should have comment or be unexported (golint)
    • Line 419: warning: exported method PriorityQueue.Pop should have comment or be unexported (golint)
    • Line 429: warning: don't use underscores in Go names; method update_priority should be updatePriority (golint)
    • Line 434: warning: comment on exported type BlockStatQueue should be of the form "BlockStatQueue ..." (with optional leading article) (golint)
    • Line 447: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 447: warning: don't use underscores in Go names; method is_consistent should be isConsistent (golint)
    • Line 452: warning: comment on exported method BlockStatQueue.Len should be of the form "Len ..." (golint)
    • Line 453: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 457: warning: comment on exported method BlockStatQueue.Print should be of the form "Print ..." (golint)
    • Line 458: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 471: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 471: warning: don't use underscores in Go names; method try_append_to_BlockStatQueue should be tryAppendToBlockStatQueue (golint)
    • Line 485: warning: don't use underscores in Go names; var action_update should be actionUpdate (golint)
    • Line 486: warning: don't use underscores in Go names; var action_skip should be actionSkip (golint)
    • Line 487: warning: don't use underscores in Go names; var action_insert should be actionInsert (golint)
    • Line 489: warning: don't use underscores in Go names; var update_index should be updateIndex (golint)
    • Line 510: warning: don't use underscores in Go names; var already_in_blockchain should be alreadyInBlockchain (golint)
    • Line 579: warning: don't use underscores in Go names; var status_code should be statusCode (golint)
    • Line 591: warning: don't use underscores in Go names; var should_forward_to_subscribers should be shouldForwardToSubscribers (golint)

gocyclo84%

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.

    • MDL/src/cipher/encoder/encoder.go
    • Line 693: warning: cyclomatic complexity 70 of function (*Decoder).value() is high (> 15) (gocyclo)
    • Line 928: warning: cyclomatic complexity 36 of function (*Encoder).value() is high (> 15) (gocyclo)
    • Line 330: warning: cyclomatic complexity 31 of function datasizeWrite() is high (> 15) (gocyclo)
    • Line 116: warning: cyclomatic complexity 21 of function DeserializeAtomic() is high (> 15) (gocyclo)
    • MDL/src/cli/address_gen.go
    • Line 199: warning: cyclomatic complexity 26 of function fiberAddressGenCmd() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 24 of function addressGenCmd() is high (> 15) (gocyclo)
    • MDL/src/api/transaction.go
    • Line 86: warning: cyclomatic complexity 17 of function transactionHandler() is high (> 15) (gocyclo)
    • Line 596: warning: cyclomatic complexity 16 of function newCreatedTransactionFuzzy() is high (> 15) (gocyclo)
    • MDL/src/transaction/create.go
    • Line 44: warning: cyclomatic complexity 52 of function create() is high (> 15) (gocyclo)
    • Line 355: warning: cyclomatic complexity 26 of function VerifyCreatedInvariants() is high (> 15) (gocyclo)
    • MDL/src/consensus/blockstat.go
    • Line 471: warning: cyclomatic complexity 21 of function (*BlockStatQueue).try_append_to_BlockStatQueue() is high (> 15) (gocyclo)
    • Line 181: warning: cyclomatic complexity 19 of function (*BlockStat).try_add_hash_and_sig() is high (> 15) (gocyclo)
    • MDL/src/api/spend.go
    • Line 288: warning: cyclomatic complexity 35 of function (createTransactionRequest).Validate() is high (> 15) (gocyclo)
    • Line 657: warning: cyclomatic complexity 21 of function walletSignTransactionHandler() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 16 of function walletCreateTransactionHandler() is high (> 15) (gocyclo)
    • MDL/src/api/blockchain.go
    • Line 209: warning: cyclomatic complexity 29 of function blocksHandler() is high (> 15) (gocyclo)
    • Line 94: warning: cyclomatic complexity 22 of function blockHandler() is high (> 15) (gocyclo)
    • MDL/src/visor/blockchain.go
    • Line 530: warning: cyclomatic complexity 32 of function (Blockchain).processTransactions() is high (> 15) (gocyclo)
    • Line 706: warning: cyclomatic complexity 26 of function (*Blockchain).WalkChain() is high (> 15) (gocyclo)
    • MDL/src/visor/visor.go
    • Line 1846: warning: cyclomatic complexity 22 of function (Visor).GetBalanceOfAddrs() is high (> 15) (gocyclo)
    • Line 1989: warning: cyclomatic complexity 19 of function (*Visor).VerifyTxnVerbose() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 16 of function (*Visor).createBlock() is high (> 15) (gocyclo)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


license0%

Checks whether your project has a LICENSE file.


misspell97%

Misspell Finds commonly misspelled English words

    • MDL/src/cipher/bip39/wordlists/french.go
    • Line 33: warning: "abriter" is a misspelling of "arbiter" (misspell)
    • Line 87: warning: "agre" is a misspelling of "agree" (misspell)
    • Line 148: warning: "appareil" is a misspelling of "apparel" (misspell)
    • Line 154: warning: "arbitre" is a misspelling of "arbiter" (misspell)
    • Line 306: warning: "brillant" is a misspelling of "brilliant" (misspell)
    • Line 390: warning: "chambre" is a misspelling of "chamber" (misspell)
    • Line 517: warning: "cylindre" is a misspelling of "cylinder" (misspell)
    • Line 788: warning: "exemple" is a misspelling of "example" (misspell)
    • Line 860: warning: "flatteur" is a misspelling of "flatter" (misspell)
    • Line 1083: warning: "inventer" is a misspelling of "inventor" (misspell)
    • Line 1289: warning: "monstre" is a misspelling of "monster" (misspell)
    • Line 1566: warning: "sence" is a misspelling of "sense" (misspell)
    • Line 1754: warning: "sculpter" is a misspelling of "sculpture" (misspell)
    • Line 1775: warning: "sergent" is a misspelling of "sergeant" (misspell)
    • Line 1794: warning: "sinistre" is a misspelling of "sinister" (misspell)
    • Line 1860: warning: "syllabe" is a misspelling of "syllable" (misspell)
    • Line 1931: warning: "trafic" is a misspelling of "traffic" (misspell)
    • Line 1967: warning: "ultrason" is a misspelling of "ultrasound" (misspell)
    • Line 2036: warning: "virtuose" is a misspelling of "virtues" (misspell)
    • MDL/src/cipher/bip39/wordlists/italian.go
    • Line 33: warning: "accusato" is a misspelling of "accusation" (misspell)
    • Line 475: warning: "dedicato" is a misspelling of "dedication" (misspell)
    • Line 476: warning: "definito" is a misspelling of "definition" (misspell)
    • Line 514: warning: "discreto" is a misspelling of "discretion" (misspell)
    • Line 1287: warning: "persuaso" is a misspelling of "persuasion" (misspell)
    • Line 1368: warning: "preparato" is a misspelling of "preparation" (misspell)
    • Line 1441: warning: "regresso" is a misspelling of "regression" (misspell)
    • Line 1689: warning: "simulato" is a misspelling of "simulation" (misspell)
    • Line 1826: warning: "tabacco" is a misspelling of "tobacco" (misspell)
    • Line 1901: warning: "transito" is a misspelling of "transition" (misspell)
    • Line 1969: warning: "vaccinato" is a misspelling of "vaccination" (misspell)
    • MDL/src/params/params.go
    • Line 9: warning: "parameteres" is a misspelling of "parameters" (misspell)
    • Line 27: warning: "overriden" is a misspelling of "overridden" (misspell)
    • Line 29: warning: "overriden" is a misspelling of "overridden" (misspell)
    • Line 31: warning: "overriden" is a misspelling of "overridden" (misspell)