Preparing report...

Report for github.com/bithyve/research

A+    Excellent!    Found 30 issues across 47 files

Tweet

gofmt93%

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!


gocyclo91%

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.

    • research/psbttest/psbt.go
    • Line 92: warning: cyclomatic complexity 28 of function testpsbt() is high (> 15) (gocyclo)
    • Line 268: warning: cyclomatic complexity 24 of function main() is high (> 15) (gocyclo)

golint48%

Golint is a linter for Go source code.

    • research/brd/colors.go
    • Line 8: warning: comment on exported var GreenColor should be of the form "GreenColor ..." (golint)
    • Line 12: warning: comment on exported var RedColor should be of the form "RedColor ..." (golint)
    • Line 14: warning: comment on exported var CyanColor should be of the form "CyanColor ..." (golint)
    • Line 16: warning: comment on exported var YellowColor should be of the form "YellowColor ..." (golint)
    • Line 20: warning: comment on exported var MagentaColor should be of the form "MagentaColor ..." (golint)
    • research/statechain/musig.go
    • Line 10: warning: exported function MuSig2CreateSign should have comment or be unexported (golint)
    • Line 42: warning: exported function MuSig2Verify should have comment or be unexported (golint)
    • research/sigs/aos.go
    • Line 10: warning: exported var Curve should have comment or be unexported (golint)
    • Line 12: warning: exported function Create21AOSSig should have comment or be unexported (golint)
    • Line 90: warning: exported function Verify21AOSSig should have comment or be unexported (golint)
    • research/statechain/statechain.go
    • Line 14: warning: exported var Storage should have comment or be unexported (golint)
    • Line 15: warning: exported var Curve should have comment or be unexported (golint)
    • Line 17: warning: exported function NewPrivateKey should have comment or be unexported (golint)
    • Line 33: warning: exported function PubkeyPointsFromPrivkey should have comment or be unexported (golint)
    • Line 38: warning: exported function BytesToNum should have comment or be unexported (golint)
    • Line 42: warning: exported function GetRandomness should have comment or be unexported (golint)
    • Line 52: warning: exported function StatechainGenMuSigKey should have comment or be unexported (golint)
    • Line 82: warning: exported function InitStorage should have comment or be unexported (golint)
    • Line 86: warning: exported function GetNewKeys should have comment or be unexported (golint)
    • Line 97: warning: exported function StateServerRequestNewPubkey should have comment or be unexported (golint)
    • Line 112: warning: exported function StatechainRequestBlindSig should have comment or be unexported (golint)
    • research/hdwallet/hdwallet.go
    • Line 1: warning: package comment should be of the form "Package hdwallet ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 144: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 192: warning: don't use underscores in Go names; var chain_code should be chainCode (golint)
    • research/statechain/blindschnorr.go
    • Line 13: warning: exported function BlindServerNonce should have comment or be unexported (golint)
    • Line 24: warning: exported function BlindClientBlind should have comment or be unexported (golint)
    • Line 46: warning: exported function BlindServerSign should have comment or be unexported (golint)
    • Line 52: warning: exported function BlindClientUnblind should have comment or be unexported (golint)
    • research/utils/util.go
    • Line 1: warning: package comment should be of the form "Package utils ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 21: warning: exported var Curve should have comment or be unexported (golint)
    • Line 23: warning: exported function Hash160 should have comment or be unexported (golint)
    • Line 31: warning: exported function Sha256 should have comment or be unexported (golint)
    • Line 39: warning: exported function Sha256File should have comment or be unexported (golint)
    • Line 52: warning: exported function DoubleSha256 should have comment or be unexported (golint)
    • Line 56: warning: exported function PrivToPub should have comment or be unexported (golint)
    • Line 60: warning: exported function Compress should have comment or be unexported (golint)
    • Line 75: warning: comment on exported function Expand should be of the form "Expand ..." (golint)
    • Line 95: warning: exported function AddPrivKeys should have comment or be unexported (golint)
    • Line 105: warning: exported function AddPubKeys should have comment or be unexported (golint)
    • Line 111: warning: exported function NewPrivateKey should have comment or be unexported (golint)
    • Line 127: warning: exported function BytesToNum should have comment or be unexported (golint)
    • research/bech32/addresses.go
    • Line 11: warning: exported var Curve should have comment or be unexported (golint)
    • Line 12: warning: exported var SegwitVersion should have comment or be unexported (golint)
    • Line 14: warning: exported function ByteArrToInt should have comment or be unexported (golint)
    • Line 22: warning: exported function GetNewp2wpkh should have comment or be unexported (golint)
    • Line 37: warning: exported function Bech32ToBase58Addr should have comment or be unexported (golint)
    • Line 61: warning: exported function Base58ToBech32Address should have comment or be unexported (golint)
    • Line 86: warning: exported function PrivKeyToWIF should have comment or be unexported (golint)
    • Line 114: warning: exported function WIFToPrivateKey should have comment or be unexported (golint)
    • Line 132: warning: exported function CheckCheckSum should have comment or be unexported (golint)
    • Line 147: warning: exported function ExportToQrCode should have comment or be unexported (golint)
    • research/rpc/rpc.go
    • Line 14: warning: exported type RPCReq should have comment or be unexported (golint)
    • Line 21: warning: exported var BitcoindURL should have comment or be unexported (golint)
    • Line 22: warning: exported var ID should have comment or be unexported (golint)
    • Line 23: warning: exported var JsonRPC should have comment or be unexported (golint)
    • Line 24: warning: exported var RPCUser should have comment or be unexported (golint)
    • Line 25: warning: exported var RPCPass should have comment or be unexported (golint)
    • Line 27: warning: exported function SetBitcoindURL should have comment or be unexported (golint)
    • Line 33: warning: exported function PostReq should have comment or be unexported (golint)
    • Line 64: warning: exported function GetBestBlockHash should have comment or be unexported (golint)
    • Line 71: warning: exported function GetBlock should have comment or be unexported (golint)
    • Line 82: warning: exported function GetBlockCount should have comment or be unexported (golint)
    • Line 89: warning: exported function GetBlockHash should have comment or be unexported (golint)
    • Line 97: warning: exported function GetBlockHeader should have comment or be unexported (golint)
    • Line 108: warning: exported function GetBlockStats should have comment or be unexported (golint)
    • Line 126: warning: exported function GetChainTips should have comment or be unexported (golint)
    • Line 133: warning: exported function GetChainTxStats should have comment or be unexported (golint)
    • Line 146: warning: exported function GetDifficulty should have comment or be unexported (golint)
    • Line 153: warning: exported function GetMempoolAncestors should have comment or be unexported (golint)
    • Line 164: warning: exported function GetMempoolEntry should have comment or be unexported (golint)
    • Line 175: warning: exported function GetMempoolInfo should have comment or be unexported (golint)
    • Line 182: warning: exported function GetRawMempool should have comment or be unexported (golint)
    • Line 189: warning: exported function GetTxOut should have comment or be unexported (golint)
    • Line 200: warning: comment on exported function GetTxOutProof should be of the form "GetTxOutProof ..." (golint)
    • Line 215: warning: exported function GetTxOutSetInfo should have comment or be unexported (golint)
    • Line 222: warning: exported function PreciousBlock should have comment or be unexported (golint)
    • Line 233: warning: exported function PruneBlockchain should have comment or be unexported (golint)
    • Line 246: warning: exported function SaveMempool should have comment or be unexported (golint)
    • Line 253: warning: comment on exported function ScanTxOutset should be of the form "ScanTxOutset ..." (golint)
    • Line 258: warning: exported function VerifyChain should have comment or be unexported (golint)
    • Line 282: warning: comment on exported function VerifyTxOutProof should be of the form "VerifyTxOutProof ..." (golint)
    • Line 287: warning: exported function GetMemoryInfo should have comment or be unexported (golint)
    • Line 294: warning: exported function GetRPCInfo should have comment or be unexported (golint)
    • Line 301: warning: exported function Help should have comment or be unexported (golint)
    • Line 308: warning: exported function Logging should have comment or be unexported (golint)
    • Line 321: warning: exported function Stop should have comment or be unexported (golint)
    • Line 328: warning: exported function Uptime should have comment or be unexported (golint)
    • Line 335: warning: exported function Generate should have comment or be unexported (golint)
    • Line 357: warning: exported function GenerateToAddress should have comment or be unexported (golint)
    • Line 371: warning: exported function SubmitBlock should have comment or be unexported (golint)
    • Line 379: warning: exported function SubmitHeader should have comment or be unexported (golint)
    • Line 387: warning: exported function AddNode should have comment or be unexported (golint)
    • Line 395: warning: exported function ClearBanned should have comment or be unexported (golint)
    • Line 402: warning: exported function DisconnectNode should have comment or be unexported (golint)
    • Line 410: warning: exported function GetAddedNodeInfo should have comment or be unexported (golint)
    • Line 417: warning: exported function GetConnectionCount should have comment or be unexported (golint)
    • Line 424: warning: exported function GetNetTotals should have comment or be unexported (golint)
    • Line 431: warning: exported function GetNetworkInfo should have comment or be unexported (golint)
    • Line 438: warning: exported function GetNodeAddresses should have comment or be unexported (golint)
    • Line 445: warning: exported function GetPeerInfo should have comment or be unexported (golint)
    • Line 452: warning: exported function ListBanned should have comment or be unexported (golint)
    • Line 459: warning: exported function Ping should have comment or be unexported (golint)
    • Line 466: warning: exported function SetBan should have comment or be unexported (golint)
    • Line 486: warning: exported function SetNetworkActive should have comment or be unexported (golint)
    • Line 494: warning: exported function AnalyzePSBT should have comment or be unexported (golint)
    • Line 502: warning: exported function CombinePSBT should have comment or be unexported (golint)
    • Line 515: warning: exported function CombineRawTransaction should have comment or be unexported (golint)
    • Line 528: warning: exported function ConvertToPsbt should have comment or be unexported (golint)
    • Line 538: warning: exported function DecodePsbt should have comment or be unexported (golint)
    • Line 546: warning: exported function DecodeRawTransaction should have comment or be unexported (golint)
    • Line 554: warning: exported function DecodeScript should have comment or be unexported (golint)
    • Line 562: warning: exported function FinalizePSBT should have comment or be unexported (golint)
    • Line 577: warning: exported function FundRawTransaction should have comment or be unexported (golint)
    • Line 592: warning: exported function GetRawTransaction should have comment or be unexported (golint)
    • Line 613: warning: exported function JoinPSBTs should have comment or be unexported (golint)
    • Line 625: warning: exported function SendRawTransaction should have comment or be unexported (golint)
    • Line 641: warning: exported function UtxoUpdatePSBT should have comment or be unexported (golint)
    • Line 649: warning: exported function CreateMultisig should have comment or be unexported (golint)
    • Line 664: warning: exported function DeriveAddresses should have comment or be unexported (golint)
    • Line 672: warning: exported function EstimateSmartFee should have comment or be unexported (golint)
    • Line 691: warning: exported function GetDescriptorInfo should have comment or be unexported (golint)
    • Line 699: warning: exported type SignMessageWithPrivkeyReturn should have comment or be unexported (golint)
    • Line 705: warning: exported function SignMessageWithPrivkey should have comment or be unexported (golint)
    • Line 713: warning: exported function ValidateAddress should have comment or be unexported (golint)
    • Line 721: warning: exported function VerifyMessage should have comment or be unexported (golint)
    • Line 729: warning: exported function AbandonTransaction should have comment or be unexported (golint)
    • Line 737: warning: exported function AbortRescan should have comment or be unexported (golint)
    • Line 743: warning: exported function AddMultisigAddress should have comment or be unexported (golint)
    • Line 761: warning: exported function BackupWallet should have comment or be unexported (golint)
    • Line 769: warning: comment on exported function BumpFee should be of the form "BumpFee ..." (golint)
    • Line 778: warning: exported function CreateWallet should have comment or be unexported (golint)
    • Line 798: warning: exported function DumpPrivKey should have comment or be unexported (golint)
    • Line 806: warning: exported function EncryptWallet should have comment or be unexported (golint)
    • Line 814: warning: exported function GetAddressesByLabel should have comment or be unexported (golint)
    • Line 822: warning: exported function GetAddressesInfo should have comment or be unexported (golint)
    • Line 830: warning: exported function GetBalance should have comment or be unexported (golint)
    • Line 854: warning: exported function GetNewAddress should have comment or be unexported (golint)
    • Line 873: warning: exported function GetRawChangeAddress should have comment or be unexported (golint)
    • Line 879: warning: exported function GetReceivedByLabel should have comment or be unexported (golint)
    • Line 887: warning: exported function GetTransaction should have comment or be unexported (golint)
    • Line 903: warning: exported function GetUnconfirmedBalance should have comment or be unexported (golint)
    • Line 909: warning: exported function GetWalletInfo should have comment or be unexported (golint)
    • Line 915: warning: exported function ImportAddress should have comment or be unexported (golint)
    • Line 938: warning: exported function ImportPrunedFunds should have comment or be unexported (golint)
    • Line 946: warning: exported function ImportPubkey should have comment or be unexported (golint)
    • Line 963: warning: exported function ImportWallet should have comment or be unexported (golint)
    • Line 971: warning: exported function KeypoolRefill should have comment or be unexported (golint)
    • Line 985: warning: exported function ListAddressGroupings should have comment or be unexported (golint)
    • Line 991: warning: exported function ListLabels should have comment or be unexported (golint)
    • Line 1002: warning: exported function ListLockUnspent should have comment or be unexported (golint)
    • Line 1008: warning: exported function ListReceivedByAddress should have comment or be unexported (golint)
    • Line 1035: warning: exported function ListReceivedByLabel should have comment or be unexported (golint)
    • Line 1059: warning: exported function ListSinceBlock should have comment or be unexported (golint)
    • Line 1089: warning: exported function ListTransactions should have comment or be unexported (golint)
    • Line 1120: warning: exported function ListUnspent should have comment or be unexported (golint)
    • Line 1148: warning: exported function ListWalletDir should have comment or be unexported (golint)
    • Line 1155: warning: exported function ListWallets should have comment or be unexported (golint)
    • Line 1164: warning: exported function RemovePrunedFunds should have comment or be unexported (golint)
    • Line 1172: warning: exported function RescanBlockchain should have comment or be unexported (golint)
    • Line 1193: warning: exported function SendToAddress should have comment or be unexported (golint)
    • Line 1230: warning: exported function SetHdSeed should have comment or be unexported (golint)
    • Line 1246: warning: exported function SetLabel should have comment or be unexported (golint)
    • Line 1254: warning: exported function SetTxFee should have comment or be unexported (golint)
    • Line 1268: warning: exported function SignMessage should have comment or be unexported (golint)
    • Line 1277: warning: exported function SignRawTransactionWithWallet should have comment or be unexported (golint)
    • Line 1286: warning: exported function UnloadWallet should have comment or be unexported (golint)
    • Line 1297: warning: exported function WalletCreateFundedPSBT should have comment or be unexported (golint)
    • Line 1313: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1339: warning: exported function WalletLock should have comment or be unexported (golint)
    • Line 1346: warning: exported function WalletPassphrase should have comment or be unexported (golint)
    • Line 1359: warning: exported function WalletPassphraseChange should have comment or be unexported (golint)
    • Line 1367: warning: exported function WalletProcessPSBT should have comment or be unexported (golint)
    • Line 1390: warning: exported function GetZmqNotifications should have comment or be unexported (golint)
    • research/psbttest/psbt.go
    • Line 16: warning: exported type GetNewAddressReturn should have comment or be unexported (golint)
    • Line 21: warning: exported type GetAddressesInfoReturn should have comment or be unexported (golint)
    • Line 37: warning: don't use underscores in Go names; struct field Witness_version should be WitnessVersion (golint)
    • Line 38: warning: don't use underscores in Go names; struct field Witness_program should be WitnessProgram (golint)
    • Line 58: warning: exported type AddMultisigAddressReturn should have comment or be unexported (golint)
    • Line 67: warning: exported type PsbtReturn should have comment or be unexported (golint)
    • Line 77: warning: exported type FinalizePSBTReturn should have comment or be unexported (golint)
    • Line 86: warning: exported type SendRawTransactionReturn should have comment or be unexported (golint)
    • research/paynym/paynym.go
    • Line 16: warning: exported type PayNym should have comment or be unexported (golint)
    • Line 25: warning: exported method PayNym.Bytes should have comment or be unexported (golint)
    • Line 57: warning: exported var Purpose should have comment or be unexported (golint)
    • Line 58: warning: exported var CoinType should have comment or be unexported (golint)
    • Line 59: warning: exported var Identity should have comment or be unexported (golint)
    • Line 61: warning: exported var AddressVersion should have comment or be unexported (golint)
    • Line 62: warning: exported var MultisigVersion should have comment or be unexported (golint)
    • Line 64: warning: exported var Curve should have comment or be unexported (golint)
    • Line 66: warning: exported function SetupWallets should have comment or be unexported (golint)
    • Line 92: warning: exported function GenPaynym should have comment or be unexported (golint)
    • research/statechain/adaptor.go
    • Line 10: warning: exported function ConstructAdaptorSig should have comment or be unexported (golint)
    • Line 32: warning: exported function VerifyAdaptorSig should have comment or be unexported (golint)
    • Line 52: warning: exported function Generate22AdaptorSchnorrChallenge should have comment or be unexported (golint)
    • research/statechain/schnorr.go
    • Line 11: warning: exported function SchnorrSign should have comment or be unexported (golint)
    • Line 25: warning: exported function SchnorrVerify should have comment or be unexported (golint)
    • Line 44: warning: exported function Construct22SchnorrPubkey should have comment or be unexported (golint)
    • Line 66: warning: exported function Generate22SchnorrChallenge should have comment or be unexported (golint)
    • research/utils/points.go
    • Line 7: warning: exported type Point should have comment or be unexported (golint)
    • Line 12: warning: exported method Point.Set should have comment or be unexported (golint)
    • Line 17: warning: exported method Point.AddCoords should have comment or be unexported (golint)
    • Line 21: warning: exported method Point.Add should have comment or be unexported (golint)
    • Line 25: warning: exported method Point.Cmp should have comment or be unexported (golint)
    • Line 29: warning: exported function Add should have comment or be unexported (golint)
    • Line 35: warning: exported method Point.ScalarMult should have comment or be unexported (golint)
    • Line 39: warning: exported function ScalarMult should have comment or be unexported (golint)
    • Line 45: warning: exported function ScalarBaseMult should have comment or be unexported (golint)
    • Line 51: warning: exported function Sub should have comment or be unexported (golint)
    • Line 61: warning: exported method Point.Bytes should have comment or be unexported (golint)
    • Line 65: warning: exported type Elgamal should have comment or be unexported (golint)
    • Line 70: warning: exported method Elgamal.Set should have comment or be unexported (golint)
    • Line 75: warning: exported function PubkeyPointsFromPrivkey should have comment or be unexported (golint)
    • Line 80: warning: exported function PointFromPrivkey should have comment or be unexported (golint)
    • research/ln/thor/reqs.go
    • Line 11: warning: exported var APIKey should have comment or be unexported (golint)
    • Line 12: warning: exported var APISecret should have comment or be unexported (golint)
    • Line 14: warning: exported function SetAPIParams should have comment or be unexported (golint)
    • research/ln/thor/thor.go
    • Line 10: warning: exported type GetLnChannelInventoryReturn should have comment or be unexported (golint)
    • Line 25: warning: exported type ThorOrderReturn should have comment or be unexported (golint)
    • Line 49: warning: exported function GetLnChannelInventory should have comment or be unexported (golint)
    • Line 69: warning: exported function GetTurboLnChannelInventory should have comment or be unexported (golint)
    • Line 89: warning: exported function PostOrder should have comment or be unexported (golint)
    • Line 149: warning: exported function PostPurchase should have comment or be unexported (golint)
    • Line 184: warning: exported function GetOrderId should have comment or be unexported (golint)
    • research/sigs/borromean.go
    • Line 11: warning: exported function SubtractOnCurve should have comment or be unexported (golint)
    • Line 25: warning: exported function SubtractOnCurveS should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell91%

Misspell Finds commonly misspelled English words

    • research/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)
    • research/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)
    • research/bip39/wordlists/spanish.go
    • Line 137: warning: "anual" is a misspelling of "annual" (misspell)
    • Line 214: warning: "autor" is a misspelling of "author" (misspell)
    • Line 1191: warning: "momento" is a misspelling of "memento" (misspell)
    • Line 1524: warning: "producto" is a misspelling of "production" (misspell)
    • Line 1526: warning: "profesor" is a misspelling of "professor" (misspell)