Preparing report...

Report for github.com/tdex-network/tdex-daemon

A+    Excellent!    Found 50 issues across 161 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


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!


gocyclo95%

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.

    • tdex-daemon/internal/core/application/operator_service.go
    • Line 707: warning: cyclomatic complexity 21 of function (*operatorService).WithdrawMarketFunds() is high (> 15) (gocyclo)
    • Line 136: warning: cyclomatic complexity 16 of function (*operatorService).DepositMarket() is high (> 15) (gocyclo)
    • Line 1008: warning: cyclomatic complexity 16 of function (*operatorService).claimDeposit() is high (> 15) (gocyclo)

golint77%

Golint is a linter for Go source code.

    • tdex-daemon/pkg/crawler/observable.go
    • Line 16: warning: exported const New should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type Status should have comment or be unexported (golint)
    • Line 28: warning: exported function NewObservableStatus should have comment or be unexported (golint)
    • Line 46: warning: exported type AddressObservable should have comment or be unexported (golint)
    • Line 97: warning: exported type TransactionObservable should have comment or be unexported (golint)
    • tdex-daemon/pkg/crawler/event.go
    • Line 6: warning: exported const CloseSignal should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported type EventType should have comment or be unexported (golint)
    • Line 32: warning: exported type CloseEvent should have comment or be unexported (golint)
    • Line 34: warning: exported method CloseEvent.Type should have comment or be unexported (golint)
    • Line 38: warning: exported type AddressEvent should have comment or be unexported (golint)
    • Line 45: warning: exported method AddressEvent.Type should have comment or be unexported (golint)
    • Line 49: warning: exported type TransactionEvent should have comment or be unexported (golint)
    • Line 57: warning: exported method TransactionEvent.Type should have comment or be unexported (golint)
    • tdex-daemon/cmd/tdex/fragmentmarket.go
    • Line 26: warning: exported const MinMilliSatPerByte should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type AssetValuePair should have comment or be unexported (golint)
    • Line 518: warning: exported type TxOut should have comment or be unexported (golint)
    • tdex-daemon/internal/core/application/types.go
    • Line 27: warning: exported type SwapFailInfo should have comment or be unexported (golint)
    • Line 58: warning: exported type Market should have comment or be unexported (golint)
    • Line 63: warning: exported type Fee should have comment or be unexported (golint)
    • Line 69: warning: exported type MarketWithFee should have comment or be unexported (golint)
    • Line 74: warning: exported type MarketWithPrice should have comment or be unexported (golint)
    • Line 79: warning: exported type Price should have comment or be unexported (golint)
    • Line 84: warning: exported type PriceWithFee should have comment or be unexported (golint)
    • Line 92: warning: exported type MarketStrategy should have comment or be unexported (golint)
    • Line 97: warning: exported type Balance should have comment or be unexported (golint)
    • Line 102: warning: exported type BalanceWithFee should have comment or be unexported (golint)
    • Line 107: warning: exported type BalanceInfo should have comment or be unexported (golint)
    • Line 113: warning: exported type WithdrawMarketReq should have comment or be unexported (golint)
    • Line 121: warning: exported type ReportMarketFee should have comment or be unexported (golint)
    • Line 126: warning: exported type AddressAndBlindingKey should have comment or be unexported (golint)
    • Line 131: warning: exported type FeeInfo should have comment or be unexported (golint)
    • Line 139: warning: exported type TxOutpoint should have comment or be unexported (golint)
    • Line 144: warning: exported type UtxoInfoList should have comment or be unexported (golint)
    • Line 150: warning: exported type UtxoInfo should have comment or be unexported (golint)
    • Line 156: warning: exported type Unspents should have comment or be unexported (golint)
    • Line 158: warning: exported method Unspents.ToUtxos should have comment or be unexported (golint)
    • Line 166: warning: exported type UnblindedResult should have comment or be unexported (golint)
    • Line 167: warning: exported type BlindingData should have comment or be unexported (golint)
    • Line 169: warning: exported type Blinder should have comment or be unexported (golint)
    • Line 173: warning: exported type FillProposalOpts should have comment or be unexported (golint)
    • Line 186: warning: exported type FillProposalResult should have comment or be unexported (golint)
    • Line 192: warning: exported type TradeHandler should have comment or be unexported (golint)
    • Line 196: warning: exported type TransactionHandler should have comment or be unexported (golint)
    • Line 209: warning: exported var BlinderManager should have comment or be unexported (golint)
    • tdex-daemon/pkg/swap/fail.go
    • Line 11: warning: exported type ErrCode should have comment or be unexported (golint)
    • Line 14: warning: exported const ErrCodeInvalidSwapRequest should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type FailOpts should have comment or be unexported (golint)
    • Line 31: warning: exported function Fail should have comment or be unexported (golint)
    • tdex-daemon/internal/core/application/wallet_service.go
    • Line 37: warning: exported type WalletService should have comment or be unexported (golint)
    • Line 81: warning: exported function NewWalletService should have comment or be unexported (golint)
    • Line 153: warning: exported type InitWalletReply should have comment or be unexported (golint)
    • Line 388: warning: exported type SendToManyRequest should have comment or be unexported (golint)
    • Line 394: warning: exported type TxOut should have comment or be unexported (golint)
    • tdex-daemon/internal/infrastructure/storage/db/inmemory/db_manager.go
    • Line 36: warning: exported type RepoManager should have comment or be unexported (golint)
    • Line 48: warning: exported type InmemoryTx should have comment or be unexported (golint)
    • Line 53: warning: exported method InmemoryTx.Commit should have comment or be unexported (golint)
    • Line 61: warning: exported method InmemoryTx.Discard should have comment or be unexported (golint)
    • Line 65: warning: exported function NewRepoManager should have comment or be unexported (golint)
    • Line 103: warning: exported method RepoManager.MarketRepository should have comment or be unexported (golint)
    • Line 107: warning: exported method RepoManager.UnspentRepository should have comment or be unexported (golint)
    • Line 111: warning: exported method RepoManager.TradeRepository should have comment or be unexported (golint)
    • Line 115: warning: exported method RepoManager.VaultRepository should have comment or be unexported (golint)
    • Line 119: warning: exported method RepoManager.Close should have comment or be unexported (golint)
    • Line 121: warning: exported method RepoManager.NewTransaction should have comment or be unexported (golint)
    • Line 121: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 128: warning: exported method RepoManager.NewUnspentsTransaction should have comment or be unexported (golint)
    • Line 128: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 132: warning: exported method RepoManager.NewPricesTransaction should have comment or be unexported (golint)
    • Line 132: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 136: warning: exported method RepoManager.RunTransaction should have comment or be unexported (golint)
    • Line 136: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 144: warning: exported method RepoManager.RunUnspentsTransaction should have comment or be unexported (golint)
    • Line 144: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 152: warning: exported method RepoManager.RunPricesTransaction should have comment or be unexported (golint)
    • Line 152: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • Line 160: warning: receiver name db should be consistent with previous receiver name d for RepoManager (golint)
    • tdex-daemon/pkg/trade/wallet.go
    • Line 17: warning: exported function NewSwapTx should have comment or be unexported (golint)
    • Line 67: warning: exported type Wallet should have comment or be unexported (golint)
    • Line 73: warning: exported function NewRandomWallet should have comment or be unexported (golint)
    • Line 86: warning: exported function NewWalletFromKey should have comment or be unexported (golint)
    • Line 93: warning: exported method Wallet.Address should have comment or be unexported (golint)
    • Line 99: warning: exported method Wallet.Script should have comment or be unexported (golint)
    • Line 104: warning: exported method Wallet.Sign should have comment or be unexported (golint)
    • Line 150: warning: exported method Wallet.PrivateKey should have comment or be unexported (golint)
    • Line 154: warning: exported method Wallet.BlindingKey should have comment or be unexported (golint)
    • tdex-daemon/pkg/bufferutil/bufferutil.go
    • Line 9: warning: exported function AssetHashFromBytes should have comment or be unexported (golint)
    • Line 14: warning: exported function AssetHashToBytes should have comment or be unexported (golint)
    • Line 24: warning: exported function ValueFromBytes should have comment or be unexported (golint)
    • Line 29: warning: exported function ValueToBytes should have comment or be unexported (golint)
    • Line 33: warning: exported function TxIDFromBytes should have comment or be unexported (golint)
    • Line 37: warning: exported function TxIDToBytes should have comment or be unexported (golint)
    • Line 45: warning: exported function CommitmentFromBytes should have comment or be unexported (golint)
    • Line 49: warning: exported function CommitmentToBytes should have comment or be unexported (golint)
    • tdex-daemon/pkg/transactionutil/transactionutil.go
    • Line 15: warning: exported type UnblindedResult should have comment or be unexported (golint)
    • Line 22: warning: exported function UnblindOutput should have comment or be unexported (golint)
    • Line 47: warning: exported function NewFeeOutput should have comment or be unexported (golint)
    • Line 56: warning: exported function GetTxIdFromPset should have comment or be unexported (golint)
    • tdex-daemon/internal/infrastructure/storage/db/inmemory/vault_memory_implementation.go
    • Line 21: warning: exported method VaultRepositoryImpl.GetOrCreateVault should have comment or be unexported (golint)
    • Line 33: warning: exported method VaultRepositoryImpl.GetAllDerivedExternalAddressesInfoForAccount should have comment or be unexported (golint)
    • Line 71: warning: exported method VaultRepositoryImpl.GetAccountByIndex should have comment or be unexported (golint)
    • Line 79: warning: exported method VaultRepositoryImpl.GetAccountByAddress should have comment or be unexported (golint)
    • Line 89: warning: exported method VaultRepositoryImpl.GetAllDerivedAddressesInfoForAccount should have comment or be unexported (golint)
    • Line 99: warning: exported method VaultRepositoryImpl.GetDerivationPathByScript should have comment or be unexported (golint)
    • tdex-daemon/internal/core/domain/vault_model.go
    • Line 12: warning: exported type AccountAndKey should have comment or be unexported (golint)
    • Line 17: warning: exported type Vault should have comment or be unexported (golint)
    • Line 34: warning: exported type AddressInfo should have comment or be unexported (golint)
    • Line 42: warning: exported type AddressesInfo should have comment or be unexported (golint)
    • Line 44: warning: exported method AddressesInfo.Addresses should have comment or be unexported (golint)
    • Line 52: warning: exported method AddressesInfo.AddressesAndKeys should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell92%

Misspell Finds commonly misspelled English words