Preparing report...

Report for github.com/vulpemventures/go-elements

A+    Excellent!    Found 33 issues across 55 files

Tweet

gofmt94%

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!


golint74%

Golint is a linter for Go source code.

    • go-elements/address/script.go
    • Line 31: warning: comment on exported function ParseScript should be of the form "ParseScript ..." (golint)
    • Line 37: warning: comment on exported function TypeOfScript should be of the form "TypeOfScript ..." (golint)
    • go-elements/block/block.go
    • Line 21: warning: exported type Block should have comment or be unexported (golint)
    • Line 26: warning: exported type Transactions should have comment or be unexported (golint)
    • Line 30: warning: exported function NewFromBuffer should have comment or be unexported (golint)
    • Line 34: warning: exported function NewFromHex should have comment or be unexported (golint)
    • Line 43: warning: exported type Header should have comment or be unexported (golint)
    • Line 76: warning: exported type DynamicFederation should have comment or be unexported (golint)
    • Line 82: warning: exported type DynamicFederationParams should have comment or be unexported (golint)
    • go-elements/block/deserialize.go
    • Line 31: warning: exported function DeserializeHeader should have comment or be unexported (golint)
    • Line 313: warning: exported function DeserializeTransactions should have comment or be unexported (golint)
    • go-elements/pset/updater.go
    • Line 28: warning: exported const NonConfidentialReissuanceTokenFlag should have comment (or a comment on this block) or be unexported (golint)
    • go-elements/block/merkle_block.go
    • Line 23: warning: exported type MerkleBlock should have comment or be unexported (golint)
    • Line 28: warning: exported type PartialMerkleTree should have comment or be unexported (golint)
    • Line 35: warning: exported function NewMerkleBlockFromBuffer should have comment or be unexported (golint)
    • Line 39: warning: exported function NewMerkleBlockFromHex should have comment or be unexported (golint)
    • Line 48: warning: exported method MerkleBlock.ExtractMatches should have comment or be unexported (golint)
    • Line 141: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-elements/block/serialize.go
    • Line 7: warning: exported method Block.SerializeBlock should have comment or be unexported (golint)
    • Line 26: warning: exported method Transactions.SerializeTransactions should have comment or be unexported (golint)
    • Line 48: warning: exported method Header.SerializeHeader should have comment or be unexported (golint)
    • go-elements/pset/doc.go
    • Line 5: warning: package comment should be of the form "Package pset ..." (golint)
    • Line 9: warning: comment on exported type PSET_PACKAGE should be of the form "PSET_PACKAGE ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported function ROLE_1_Creator should be of the form "ROLE_1_Creator ..." (golint)
    • Line 26: warning: don't use underscores in Go names; func ROLE_1_Creator should be ROLE1Creator (golint)
    • Line 28: warning: comment on exported function ROLE_2_Updater should be of the form "ROLE_2_Updater ..." (golint)
    • Line 33: warning: don't use underscores in Go names; func ROLE_2_Updater should be ROLE2Updater (golint)
    • Line 35: warning: comment on exported function ROLE_3_Blinder should be of the form "ROLE_3_Blinder ..." (golint)
    • Line 43: warning: don't use underscores in Go names; func ROLE_3_Blinder should be ROLE3Blinder (golint)
    • Line 45: warning: comment on exported function ROLE_4_Signer should be of the form "ROLE_4_Signer ..." (golint)
    • Line 50: warning: don't use underscores in Go names; func ROLE_4_Signer should be ROLE4Signer (golint)
    • Line 52: warning: comment on exported function ROLE_5_Finalizer should be of the form "ROLE_5_Finalizer ..." (golint)
    • Line 58: warning: don't use underscores in Go names; func ROLE_5_Finalizer should be ROLE5Finalizer (golint)
    • Line 60: warning: comment on exported function ROLE_6_Extractor should be of the form "ROLE_6_Extractor ..." (golint)
    • Line 62: warning: don't use underscores in Go names; func ROLE_6_Extractor should be ROLE6Extractor (golint)
    • Line 64: warning: comment on exported function TX_P2WPKH should be of the form "TX_P2WPKH ..." (golint)
    • go-elements/pegin/pegin.go
    • Line 27: warning: exported type AddressInfo should have comment or be unexported (golint)
    • Line 160: warning: exported type FedpegInfo should have comment or be unexported (golint)
    • Line 237: warning: exported function GetPeginTxOutIndexAndAmount should have comment or be unexported (golint)
    • Line 336: warning: exported function SerializeValue should have comment or be unexported (golint)
    • Line 346: warning: exported function StripWitnessFromBtcTx should have comment or be unexported (golint)
    • go-elements/confidential/confidential.go
    • Line 61: warning: exported type UnblindIssuanceResult should have comment or be unexported (golint)
    • Line 66: warning: exported function UnblindIssuance should have comment or be unexported (golint)
    • Line 102: warning: exported type RangeProofArgs should have comment or be unexported (golint)
    • Line 141: warning: exported type SurjectionProofArgs should have comment or be unexported (golint)
    • Line 161: warning: exported type VerifySurjectionProofArgs should have comment or be unexported (golint)
    • go-elements/pset/pset.go
    • Line 293: warning: exported method Pset.ValidateAllSignatures should have comment or be unexported (golint)
    • Line 306: warning: exported method Pset.ValidateInputSignatures should have comment or be unexported (golint)

gocyclo78%

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.

    • go-elements/pset/blinder.go
    • Line 681: warning: cyclomatic complexity 18 of function verifyBlinding() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 17 of function (*Blinder).unblindInputsToIssuanceBlindingData() is high (> 15) (gocyclo)
    • Line 334: warning: cyclomatic complexity 16 of function (*Blinder).blindInputs() is high (> 15) (gocyclo)
    • go-elements/pset/pset.go
    • Line 90: warning: cyclomatic complexity 18 of function deserialize() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 16 of function (*Pset).getHashAndScriptForSignature() is high (> 15) (gocyclo)
    • go-elements/pset/pset_input.go
    • Line 88: warning: cyclomatic complexity 42 of function (*PInput).deserialize() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 26 of function (*PInput).serialize() is high (> 15) (gocyclo)
    • go-elements/pset/pset_test.go
    • Line 1206: warning: cyclomatic complexity 24 of function TestBroadcastBlindedIssuanceAndReIssuanceTx() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 18 of function TestBroadcastBlindedSwapTx() is high (> 15) (gocyclo)
    • go-elements/pset/updater.go
    • Line 94: warning: cyclomatic complexity 20 of function (*Updater).addPartialSignature() is high (> 15) (gocyclo)
    • Line 561: warning: cyclomatic complexity 18 of function (AddReissuanceArgs).validate() is high (> 15) (gocyclo)

ineffassign78%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words