Preparing report...

Report for github.com/NebulousLabs/Sia

A+    Excellent!    Found 126 issues across 428 files

Tweet

gofmt99%

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!


gocyclo72%

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.

    • Sia/modules/wallet/wallet_test.go
    • Line 428: warning: cyclomatic complexity 24 of function TestAdvanceLookaheadForceRescan() is high (> 15) (gocyclo)
    • Line 565: warning: cyclomatic complexity 17 of function TestDistantWallets() is high (> 15) (gocyclo)
    • Sia/modules/wallet/encrypt.go
    • Line 95: warning: cyclomatic complexity 20 of function (*Wallet).managedUnlock() is high (> 15) (gocyclo)
    • Line 456: warning: cyclomatic complexity 19 of function (*Wallet).managedChangeKey() is high (> 15) (gocyclo)
    • Sia/modules/wallet/transactionbuilder.go
    • Line 261: warning: cyclomatic complexity 21 of function (*transactionBuilder).FundSiafunds() is high (> 15) (gocyclo)
    • Line 119: warning: cyclomatic complexity 21 of function (*transactionBuilder).FundSiacoins() is high (> 15) (gocyclo)
    • Line 544: warning: cyclomatic complexity 17 of function (*transactionBuilder).Sign() is high (> 15) (gocyclo)
    • Sia/modules/transactionpool/accept.go
    • Line 105: warning: cyclomatic complexity 23 of function (*TransactionPool).handleConflicts() is high (> 15) (gocyclo)
    • Line 233: warning: cyclomatic complexity 19 of function (*TransactionPool).acceptTransactionSet() is high (> 15) (gocyclo)
    • Sia/modules/wallet/transactions_test.go
    • Line 142: warning: cyclomatic complexity 23 of function TestIntegrationTransaction() is high (> 15) (gocyclo)
    • Line 480: warning: cyclomatic complexity 18 of function BenchmarkAddressTransactions() is high (> 15) (gocyclo)
    • Line 414: warning: cyclomatic complexity 17 of function TestTransactionInputOutputIDs() is high (> 15) (gocyclo)
    • Sia/sync/threadgroup_test.go
    • Line 79: warning: cyclomatic complexity 20 of function TestThreadGroupStop() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 18 of function TestThreadGroupSiaExample() is high (> 15) (gocyclo)
    • Sia/cmd/siad/server.go
    • Line 208: warning: cyclomatic complexity 19 of function updateToRelease() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 19 of function (*Server).loadModules() is high (> 15) (gocyclo)
    • Sia/modules/wallet/seed.go
    • Line 336: warning: cyclomatic complexity 33 of function (*Wallet).SweepSeed() is high (> 15) (gocyclo)
    • Line 226: warning: cyclomatic complexity 16 of function (*Wallet).LoadSeed() is high (> 15) (gocyclo)
    • Sia/modules/renter/proto/merkleroots_test.go
    • Line 292: warning: cyclomatic complexity 25 of function TestDelete() is high (> 15) (gocyclo)
    • Line 196: warning: cyclomatic complexity 21 of function TestDeleteLastRoot() is high (> 15) (gocyclo)
    • Line 116: warning: cyclomatic complexity 17 of function TestInsertMerkleRoot() is high (> 15) (gocyclo)
    • Sia/node/api/hostdb_test.go
    • Line 649: warning: cyclomatic complexity 59 of function TestHostDBAndRenterUploadDynamicIPs() is high (> 15) (gocyclo)
    • Line 426: warning: cyclomatic complexity 49 of function TestHostDBAndRenterDownloadDynamicIPs() is high (> 15) (gocyclo)
    • Line 900: warning: cyclomatic complexity 45 of function TestHostDBAndRenterFormDynamicIPs() is high (> 15) (gocyclo)
    • Line 1106: warning: cyclomatic complexity 42 of function TestHostDBAndRenterRenewDynamicIPs() is high (> 15) (gocyclo)
    • Line 324: warning: cyclomatic complexity 23 of function TestHostDBScanOnlineOffline() is high (> 15) (gocyclo)
    • Line 147: warning: cyclomatic complexity 22 of function TestHostDBHostsHandler() is high (> 15) (gocyclo)
    • Line 27: warning: cyclomatic complexity 22 of function TestHostDBHostsActiveHandler() is high (> 15) (gocyclo)
    • Sia/modules/transactionpool/transactionpool_test.go
    • Line 672: warning: cyclomatic complexity 79 of function TestBigTpool() is high (> 15) (gocyclo)
    • Line 1073: warning: cyclomatic complexity 52 of function TestTpoolRevert() is high (> 15) (gocyclo)
    • Line 484: warning: cyclomatic complexity 38 of function TestHeapFees() is high (> 15) (gocyclo)
    • Line 351: warning: cyclomatic complexity 22 of function TestTpoolScalability() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 21 of function TestFeeEstimation() is high (> 15) (gocyclo)
    • Sia/modules/transactionpool/update_test.go
    • Line 14: warning: cyclomatic complexity 27 of function TestFindSets() is high (> 15) (gocyclo)
    • Line 169: warning: cyclomatic complexity 24 of function TestValidRevertedTransaction() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 22 of function TestTransactionPoolPruning() is high (> 15) (gocyclo)
    • Line 384: warning: cyclomatic complexity 21 of function TestDatabaseUpgrade() is high (> 15) (gocyclo)
    • Sia/encoding/marshal.go
    • Line 146: warning: cyclomatic complexity 22 of function (*Encoder).encode() is high (> 15) (gocyclo)
    • Line 393: warning: cyclomatic complexity 21 of function (*Decoder).decode() is high (> 15) (gocyclo)
    • Sia/modules/consensus/synchronize.go
    • Line 267: warning: cyclomatic complexity 23 of function (*ConsensusSet).rpcSendBlocks() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 21 of function (*ConsensusSet).managedReceiveBlocks() is high (> 15) (gocyclo)
    • Sia/modules/renter/hostdb/scan.go
    • Line 387: warning: cyclomatic complexity 23 of function (*HostDB).threadedScan() is high (> 15) (gocyclo)
    • Line 145: warning: cyclomatic complexity 22 of function (*HostDB).updateEntry() is high (> 15) (gocyclo)
    • Line 23: warning: cyclomatic complexity 17 of function (*HostDB).queueScan() is high (> 15) (gocyclo)
    • Sia/modules/wallet/seed_test.go
    • Line 89: warning: cyclomatic complexity 23 of function TestLoadSeed() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 20 of function TestSweepSeedSentFunds() is high (> 15) (gocyclo)
    • Line 428: warning: cyclomatic complexity 19 of function TestSweepSeedCoinsAndFunds() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 17 of function TestPrimarySeed() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 17 of function TestSweepSeedFunds() is high (> 15) (gocyclo)
    • Sia/node/api/renterhost_test.go
    • Line 161: warning: cyclomatic complexity 64 of function TestHostAndRentVanilla() is high (> 15) (gocyclo)
    • Line 1873: warning: cyclomatic complexity 46 of function TestRepairLoopBlocking() is high (> 15) (gocyclo)
    • Line 535: warning: cyclomatic complexity 41 of function TestHostAndRentManyFiles() is high (> 15) (gocyclo)
    • Line 2105: warning: cyclomatic complexity 38 of function TestRemoteFileRepairMassive() is high (> 15) (gocyclo)
    • Line 1683: warning: cyclomatic complexity 36 of function TestRenterMissingHosts() is high (> 15) (gocyclo)
    • Line 1249: warning: cyclomatic complexity 35 of function TestHostAndRentReload() is high (> 15) (gocyclo)
    • Line 745: warning: cyclomatic complexity 34 of function TestRenterUploadDownload() is high (> 15) (gocyclo)
    • Line 1000: warning: cyclomatic complexity 32 of function TestRenterRenew() is high (> 15) (gocyclo)
    • Line 1418: warning: cyclomatic complexity 32 of function TestHostAndRenterRenewInterrupt() is high (> 15) (gocyclo)
    • Line 1553: warning: cyclomatic complexity 26 of function TestUploadedBytesReporting() is high (> 15) (gocyclo)
    • Line 28: warning: cyclomatic complexity 26 of function TestHostObligationAcceptingContracts() is high (> 15) (gocyclo)
    • Line 889: warning: cyclomatic complexity 24 of function TestRenterParallelDelete() is high (> 15) (gocyclo)
    • Line 419: warning: cyclomatic complexity 24 of function TestHostAndRentMultiHost() is high (> 15) (gocyclo)
    • Line 1137: warning: cyclomatic complexity 20 of function TestRenterAllowance() is high (> 15) (gocyclo)
    • Sia/modules/wallet/update.go
    • Line 244: warning: cyclomatic complexity 26 of function (*Wallet).computeProcessedTransactionsFromBlock() is high (> 15) (gocyclo)
    • Line 475: warning: cyclomatic complexity 19 of function (*Wallet).ReceiveUpdatedUnconfirmedTransactions() is high (> 15) (gocyclo)
    • Sia/modules/host/contractmanager/sectorupdate_test.go
    • Line 1689: warning: cyclomatic complexity 50 of function TestFailingStorageFolder() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 36 of function TestAddSector() is high (> 15) (gocyclo)
    • Line 1359: warning: cyclomatic complexity 35 of function TestDeleteSectorVirtual() is high (> 15) (gocyclo)
    • Line 940: warning: cyclomatic complexity 34 of function TestRemoveSector() is high (> 15) (gocyclo)
    • Line 373: warning: cyclomatic complexity 34 of function TestAddSectorRecovery() is high (> 15) (gocyclo)
    • Line 1080: warning: cyclomatic complexity 34 of function TestRemoveSectorVirtual() is high (> 15) (gocyclo)
    • Line 1219: warning: cyclomatic complexity 34 of function TestDeleteSector() is high (> 15) (gocyclo)
    • Line 653: warning: cyclomatic complexity 33 of function TestAddVirtualSectorParallel() is high (> 15) (gocyclo)
    • Line 799: warning: cyclomatic complexity 33 of function TestAddVirtualSectorMassiveParallel() is high (> 15) (gocyclo)
    • Line 516: warning: cyclomatic complexity 33 of function TestAddVirtualSectorSerial() is high (> 15) (gocyclo)
    • Line 1503: warning: cyclomatic complexity 31 of function TestSectorBalancing() is high (> 15) (gocyclo)
    • Sia/siatest/renter/renter_test.go
    • Line 1826: warning: cyclomatic complexity 84 of function TestRenterSpendingReporting() is high (> 15) (gocyclo)
    • Line 1372: warning: cyclomatic complexity 51 of function TestRenterContractsEndpoint() is high (> 15) (gocyclo)
    • Line 901: warning: cyclomatic complexity 38 of function TestRenewFailing() is high (> 15) (gocyclo)
    • Line 1063: warning: cyclomatic complexity 35 of function TestRenterCancelAllowance() is high (> 15) (gocyclo)
    • Line 79: warning: cyclomatic complexity 32 of function testClearDownloadHistory() is high (> 15) (gocyclo)
    • Line 1219: warning: cyclomatic complexity 31 of function TestRenterContractEndHeight() is high (> 15) (gocyclo)
    • Line 1607: warning: cyclomatic complexity 27 of function TestRenterPersistData() is high (> 15) (gocyclo)
    • Line 797: warning: cyclomatic complexity 20 of function TestRedundancyReporting() is high (> 15) (gocyclo)
    • Line 1732: warning: cyclomatic complexity 20 of function TestRenterResetAllowance() is high (> 15) (gocyclo)
    • Line 462: warning: cyclomatic complexity 18 of function testStreamingCache() is high (> 15) (gocyclo)
    • Line 2341: warning: cyclomatic complexity 18 of function checkContractVsReportedSpending() is high (> 15) (gocyclo)
    • Sia/persist/json_test.go
    • Line 116: warning: cyclomatic complexity 38 of function TestLoadJSONCorruptedFiles() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 20 of function TestSaveLoadJSON() is high (> 15) (gocyclo)
    • Sia/node/api/renter.go
    • Line 186: warning: cyclomatic complexity 23 of function (*API).renterHandlerPOST() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 20 of function (*API).renterContractsHandler() is high (> 15) (gocyclo)
    • Sia/modules/consensus/synchronize_test.go
    • Line 1168: warning: cyclomatic complexity 37 of function TestIntegrationRelaySynchronize() is high (> 15) (gocyclo)
    • Line 318: warning: cyclomatic complexity 25 of function TestIntegrationRPCSendBlocks() is high (> 15) (gocyclo)
    • Line 530: warning: cyclomatic complexity 22 of function TestRPCSendBlockSendsOnlyNecessaryBlocks() is high (> 15) (gocyclo)
    • Line 906: warning: cyclomatic complexity 19 of function TestIntegrationSendBlkRPC() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 18 of function TestSynchronize() is high (> 15) (gocyclo)
    • Sia/modules/host/storageobligations_smoke_test.go
    • Line 360: warning: cyclomatic complexity 35 of function TestMultiSectorStorageObligationStack() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 29 of function TestSingleSectorStorageObligationStack() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 29 of function TestAutoRevisionSubmission() is high (> 15) (gocyclo)
    • Line 91: warning: cyclomatic complexity 19 of function TestBlankStorageObligation() is high (> 15) (gocyclo)
    • Sia/modules/consensus/accept_txntypes_test.go
    • Line 165: warning: cyclomatic complexity 20 of function (*consensusSetTester).testValidStorageProofBlocks() is high (> 15) (gocyclo)
    • Line 577: warning: cyclomatic complexity 17 of function (*consensusSetTester).testSpendSiafunds() is high (> 15) (gocyclo)
    • Line 419: warning: cyclomatic complexity 16 of function (*consensusSetTester).testFileContractRevision() is high (> 15) (gocyclo)
    • Sia/modules/host/contractmanager/storagefoldershrink_test.go
    • Line 932: warning: cyclomatic complexity 43 of function TestShrinkStorageFolderWAL() is high (> 15) (gocyclo)
    • Line 723: warning: cyclomatic complexity 43 of function TestShrinkStorageFolderShutdownAfterMove() is high (> 15) (gocyclo)
    • Line 127: warning: cyclomatic complexity 43 of function TestShrinkStorageFolderWithSectors() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 34 of function TestShrinkStorageFolderIncompleteWrite() is high (> 15) (gocyclo)
    • Line 510: warning: cyclomatic complexity 33 of function TestShrinkStorageFolderIncompleteWriteForce() is high (> 15) (gocyclo)
    • Line 1138: warning: cyclomatic complexity 32 of function TestShrinkSingleStorageFolder() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 24 of function TestShrinkStorageFolder() is high (> 15) (gocyclo)
    • Sia/modules/gateway/nodes_test.go
    • Line 369: warning: cyclomatic complexity 20 of function TestHealthyNodeListPruning() is high (> 15) (gocyclo)
    • Line 276: warning: cyclomatic complexity 17 of function TestPruneNodeThreshold() is high (> 15) (gocyclo)
    • Sia/node/api/wallet_test.go
    • Line 565: warning: cyclomatic complexity 65 of function TestWalletTransactionGETid() is high (> 15) (gocyclo)
    • Line 1378: warning: cyclomatic complexity 25 of function TestWalletSiacoins() is high (> 15) (gocyclo)
    • Line 1092: warning: cyclomatic complexity 24 of function TestWalletSiafunds() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 23 of function TestWalletGETSiacoins() is high (> 15) (gocyclo)
    • Line 1267: warning: cyclomatic complexity 20 of function TestWalletChangePassword() is high (> 15) (gocyclo)
    • Line 928: warning: cyclomatic complexity 19 of function TestWalletRelativePathErrorSiag() is high (> 15) (gocyclo)
    • Line 487: warning: cyclomatic complexity 16 of function TestIntegrationWalletLoadSeedPOST() is high (> 15) (gocyclo)
    • Line 1609: warning: cyclomatic complexity 16 of function TestWalletManyTransactions() is high (> 15) (gocyclo)
    • Sia/node/api/host_test.go
    • Line 558: warning: cyclomatic complexity 32 of function TestResizeNonemptyStorageFolder() is high (> 15) (gocyclo)
    • Line 715: warning: cyclomatic complexity 24 of function TestStorageFolderUnavailable() is high (> 15) (gocyclo)
    • Line 57: warning: cyclomatic complexity 21 of function TestEstimateWeight() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 20 of function TestStorageHandler() is high (> 15) (gocyclo)
    • Line 918: warning: cyclomatic complexity 20 of function TestRemoveStorageFolderForced() is high (> 15) (gocyclo)
    • Line 186: warning: cyclomatic complexity 19 of function TestWorkingStatus() is high (> 15) (gocyclo)
    • Line 476: warning: cyclomatic complexity 19 of function TestResizeEmptyStorageFolder() is high (> 15) (gocyclo)
    • Line 1007: warning: cyclomatic complexity 18 of function TestDeleteSector() is high (> 15) (gocyclo)
    • Sia/node/api/renter_test.go
    • Line 1531: warning: cyclomatic complexity 79 of function TestContractorHostRemoval() is high (> 15) (gocyclo)
    • Line 823: warning: cyclomatic complexity 27 of function TestRenterHandlerRename() is high (> 15) (gocyclo)
    • Line 1328: warning: cyclomatic complexity 21 of function TestRenterPricesHandlerIgnorePricey() is high (> 15) (gocyclo)
    • Line 1225: warning: cyclomatic complexity 21 of function TestRenterPricesHandlerCheap() is high (> 15) (gocyclo)
    • Line 2014: warning: cyclomatic complexity 20 of function TestAdversarialPriceRenewal() is high (> 15) (gocyclo)
    • Line 589: warning: cyclomatic complexity 19 of function TestRenterHandlerContracts() is high (> 15) (gocyclo)
    • Line 674: warning: cyclomatic complexity 19 of function TestRenterHandlerGetAndPost() is high (> 15) (gocyclo)
    • Line 1433: warning: cyclomatic complexity 19 of function TestRenterPricesHandlerPricey() is high (> 15) (gocyclo)
    • Line 1069: warning: cyclomatic complexity 18 of function TestRenterRelativePathErrorDownload() is high (> 15) (gocyclo)
    • Line 1909: warning: cyclomatic complexity 18 of function TestExhaustedContracts() is high (> 15) (gocyclo)
    • Line 111: warning: cyclomatic complexity 17 of function runDownloadTest() is high (> 15) (gocyclo)
    • Sia/modules/wallet/transactionbuilder_test.go
    • Line 284: warning: cyclomatic complexity 25 of function TestConcurrentBuildersSingleOutput() is high (> 15) (gocyclo)
    • Line 183: warning: cyclomatic complexity 20 of function TestConcurrentBuilders() is high (> 15) (gocyclo)
    • Line 416: warning: cyclomatic complexity 19 of function TestParallelBuilders() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 18 of function TestViewAdded() is high (> 15) (gocyclo)
    • Sia/modules/renter/download.go
    • Line 344: warning: cyclomatic complexity 17 of function (*Renter).managedNewDownload() is high (> 15) (gocyclo)
    • Line 265: warning: cyclomatic complexity 17 of function (*Renter).managedDownload() is high (> 15) (gocyclo)
    • Sia/modules/gateway/peers_test.go
    • Line 871: warning: cyclomatic complexity 29 of function TestOverloadedBootstrap() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 24 of function TestConnectRejectsVersions() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 24 of function TestListen() is high (> 15) (gocyclo)
    • Line 993: warning: cyclomatic complexity 20 of function TestPeerManagerPriority() is high (> 15) (gocyclo)

golint98%

Golint is a linter for Go source code.

    • Sia/modules/host/dependencies.go
    • Line 10: warning: error var mockErrListen should have name of the form errFoo (golint)
    • Line 11: warning: error var mockErrLoadFile should have name of the form errFoo (golint)
    • Line 12: warning: error var mockErrMkdirAll should have name of the form errFoo (golint)
    • Line 13: warning: error var mockErrNewLogger should have name of the form errFoo (golint)
    • Line 14: warning: error var mockErrOpenDatabase should have name of the form errFoo (golint)
    • Line 15: warning: error var mockErrReadFile should have name of the form errFoo (golint)
    • Line 16: warning: error var mockErrRemoveFile should have name of the form errFoo (golint)
    • Line 17: warning: error var mockErrSymlink should have name of the form errFoo (golint)
    • Line 18: warning: error var mockErrWriteFile should have name of the form errFoo (golint)
    • Sia/modules/host/contractmanager/dependencies.go
    • Line 10: warning: error var mockErrListen should have name of the form errFoo (golint)
    • Line 11: warning: error var mockErrLoadFile should have name of the form errFoo (golint)
    • Line 12: warning: error var mockErrMkdirAll should have name of the form errFoo (golint)
    • Line 13: warning: error var mockErrNewLogger should have name of the form errFoo (golint)
    • Line 14: warning: error var mockErrOpenDatabase should have name of the form errFoo (golint)
    • Line 15: warning: error var mockErrReadFile should have name of the form errFoo (golint)
    • Line 16: warning: error var mockErrRemoveFile should have name of the form errFoo (golint)
    • Line 17: warning: error var mockErrSymlink should have name of the form errFoo (golint)
    • Line 18: warning: error var mockErrWriteFile should have name of the form errFoo (golint)
    • Sia/compatibility/siag_1.0_test.go
    • Line 18: warning: don't use underscores in Go names; type KeyPairSiag_1_0 should be KeyPairSiag1_0 (golint)
    • Line 28: warning: don't use underscores in Go names; func verifyKeysSiag_1_0 should be verifyKeysSiag1_0 (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell99%

Misspell Finds commonly misspelled English words