Preparing report...

Report for github.com/phoreproject/pm-go

(v2.4.3+incompatible)

A+    Excellent!    Found 77 issues across 300 files

Tweet

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!


gofmt99%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo76%

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.

    • core/utils.go
    • Line 26: warning: cyclomatic complexity 25 of function (*OpenBazaarNode).BuildTransactionRecords() is high (> 15) (gocyclo)
    • core/confirmation.go
    • Line 195: warning: cyclomatic complexity 21 of function (*OpenBazaarNode).RejectOfflineOrder() is high (> 15) (gocyclo)
    • Line 102: warning: cyclomatic complexity 19 of function (*OpenBazaarNode).ConfirmOfflineOrder() is high (> 15) (gocyclo)
    • Line 290: warning: cyclomatic complexity 19 of function (*OpenBazaarNode).ValidateOrderConfirmation() is high (> 15) (gocyclo)
    • wallet/listeners/transaction_listener.go
    • Line 92: warning: cyclomatic complexity 45 of function (*TransactionListener).OnTransactionReceived() is high (> 15) (gocyclo)
    • Line 258: warning: cyclomatic complexity 23 of function (*TransactionListener).processSalePayment() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 20 of function (*TransactionListener).processPurchasePayment() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 18 of function (*TransactionListener).adjustInventory() is high (> 15) (gocyclo)
    • core/spend.go
    • Line 49: warning: cyclomatic complexity 30 of function (*OpenBazaarNode).Spend() is high (> 15) (gocyclo)
    • repo/db/cases_test.go
    • Line 562: warning: cyclomatic complexity 29 of function TestCasesDB_GetAll() is high (> 15) (gocyclo)
    • Line 343: warning: cyclomatic complexity 25 of function TestCasesGetCaseMetaData() is high (> 15) (gocyclo)
    • Line 425: warning: cyclomatic complexity 22 of function TestGetByCaseID() is high (> 15) (gocyclo)
    • Line 679: warning: cyclomatic complexity 19 of function TestGetDisputesForDisputeExpiryReturnsRelevantRecords() is high (> 15) (gocyclo)
    • core/ratings.go
    • Line 22: warning: cyclomatic complexity 28 of function ValidateRating() is high (> 15) (gocyclo)
    • repo/db/sales_test.go
    • Line 377: warning: cyclomatic complexity 26 of function TestSalesDB_GetAll() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 17 of function TestPutSale() is high (> 15) (gocyclo)
    • Line 639: warning: cyclomatic complexity 16 of function TestUpdateSaleLastDisputeTimeoutNotifiedAt() is high (> 15) (gocyclo)
    • Line 535: warning: cyclomatic complexity 16 of function TestGetSalesForDisputeTimeoutReturnsRelevantRecords() is high (> 15) (gocyclo)
    • repo/init.go
    • Line 32: warning: cyclomatic complexity 18 of function DoInit() is high (> 15) (gocyclo)
    • cmd/decrypt.go
    • Line 24: warning: cyclomatic complexity 17 of function (*DecryptDatabase).Execute() is high (> 15) (gocyclo)
    • core/record_aging_notifier_test.go
    • Line 21: warning: cyclomatic complexity 53 of function TestPerformTaskCreatesModeratorDisputeExpiryNotifications() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 51 of function TestPerformTaskCreatesBuyerDisputeTimeoutNotifications() is high (> 15) (gocyclo)
    • Line 691: warning: cyclomatic complexity 43 of function TestPerformTaskCreatesPurchaseExpiryNotifications() is high (> 15) (gocyclo)
    • Line 967: warning: cyclomatic complexity 30 of function TestPerformTaskCreatesVendorDisputeTimeoutNotifications() is high (> 15) (gocyclo)
    • repo/listing.go
    • Line 1295: warning: cyclomatic complexity 116 of function (*Listing).ValidateListing() is high (> 15) (gocyclo)
    • Line 1653: warning: cyclomatic complexity 26 of function (*Listing).validatePhysicalListing() is high (> 15) (gocyclo)
    • cmd/encrypt.go
    • Line 24: warning: cyclomatic complexity 22 of function (*EncryptDatabase).Execute() is high (> 15) (gocyclo)
    • api/jsonapi.go
    • Line 1823: warning: cyclomatic complexity 27 of function (*jsonAPIHandler).GETModerators() is high (> 15) (gocyclo)
    • Line 99: warning: cyclomatic complexity 26 of function (*jsonAPIHandler).ServeHTTP() is high (> 15) (gocyclo)
    • Line 3725: warning: cyclomatic complexity 23 of function (*jsonAPIHandler).POSTFetchRatings() is high (> 15) (gocyclo)
    • Line 2034: warning: cyclomatic complexity 21 of function (*jsonAPIHandler).POSTOrderComplete() is high (> 15) (gocyclo)
    • Line 2120: warning: cyclomatic complexity 20 of function (*jsonAPIHandler).POSTOpenDispute() is high (> 15) (gocyclo)
    • Line 1468: warning: cyclomatic complexity 18 of function (*jsonAPIHandler).GETListing() is high (> 15) (gocyclo)
    • Line 2875: warning: cyclomatic complexity 17 of function (*jsonAPIHandler).POSTFetchProfiles() is high (> 15) (gocyclo)
    • repo/migrations/Migration018.go
    • Line 17: warning: cyclomatic complexity 20 of function (Migration018).Up() is high (> 15) (gocyclo)
    • Line 132: warning: cyclomatic complexity 19 of function (Migration018).Down() is high (> 15) (gocyclo)
    • core/order_test.go
    • Line 14: warning: cyclomatic complexity 38 of function TestOpenBazaarNode_CalculateOrderTotal() is high (> 15) (gocyclo)
    • Line 298: warning: cyclomatic complexity 38 of function TestOpenBazaarNode_CalculateOrderTotalWithV4Schema() is high (> 15) (gocyclo)
    • repo/profile.go
    • Line 129: warning: cyclomatic complexity 21 of function (*Profile).validateModeratorFees() is high (> 15) (gocyclo)
    • cmd/setapicreds.go
    • Line 26: warning: cyclomatic complexity 18 of function (*SetAPICreds).Execute() is high (> 15) (gocyclo)
    • repo/migrations/Migration028.go
    • Line 499: warning: cyclomatic complexity 48 of function (migrateListingsToV5Schema).Down() is high (> 15) (gocyclo)
    • Line 229: warning: cyclomatic complexity 44 of function (migrateListingsToV5Schema).Up() is high (> 15) (gocyclo)
    • core/fulfillment.go
    • Line 27: warning: cyclomatic complexity 35 of function (*OpenBazaarNode).FulfillOrder() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 26 of function (*OpenBazaarNode).ValidateOrderFulfillment() is high (> 15) (gocyclo)
    • core/record_aging_notifier.go
    • Line 351: warning: cyclomatic complexity 20 of function (*recordAgingNotifier).generateModeratorDisputeExpiryNotifications() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 20 of function (*recordAgingNotifier).generateBuyerDisputeTimeoutNotifications() is high (> 15) (gocyclo)
    • Line 272: warning: cyclomatic complexity 18 of function (*recordAgingNotifier).generateBuyerDisputeExpiryNotifications() is high (> 15) (gocyclo)
    • repo/migrations/Migration020.go
    • Line 121: warning: cyclomatic complexity 18 of function (Migration020).Down() is high (> 15) (gocyclo)
    • Line 28: warning: cyclomatic complexity 18 of function (Migration020).Up() is high (> 15) (gocyclo)
    • core/order.go
    • Line 1582: warning: cyclomatic complexity 69 of function (*OpenBazaarNode).ValidateOrder() is high (> 15) (gocyclo)
    • Line 1367: warning: cyclomatic complexity 30 of function (*OpenBazaarNode).calculateShippingTotalForListings() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 28 of function (*OpenBazaarNode).createContractWithOrder() is high (> 15) (gocyclo)
    • Line 863: warning: cyclomatic complexity 26 of function (*OpenBazaarNode).CheckoutBreakdown() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 23 of function prepareModeratedOrderContract() is high (> 15) (gocyclo)
    • Line 1172: warning: cyclomatic complexity 19 of function (*OpenBazaarNode).CalculateOrderTotal() is high (> 15) (gocyclo)
    • Line 1084: warning: cyclomatic complexity 18 of function (*OpenBazaarNode).CancelOfflineOrder() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 16 of function processOfflineDirectOrder() is high (> 15) (gocyclo)
    • net/service/handlers.go
    • Line 287: warning: cyclomatic complexity 47 of function (*OpenBazaarService).handleOrder() is high (> 15) (gocyclo)
    • Line 692: warning: cyclomatic complexity 40 of function (*OpenBazaarService).handleReject() is high (> 15) (gocyclo)
    • Line 1137: warning: cyclomatic complexity 38 of function (*OpenBazaarService).handleOrderCompletion() is high (> 15) (gocyclo)
    • Line 879: warning: cyclomatic complexity 34 of function (*OpenBazaarService).handleRefund() is high (> 15) (gocyclo)
    • Line 1451: warning: cyclomatic complexity 27 of function (*OpenBazaarService).handleDisputeClose() is high (> 15) (gocyclo)
    • Line 1613: warning: cyclomatic complexity 26 of function analyzeForMissingMessages() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 25 of function (*OpenBazaarService).HandlerForMsgType() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 24 of function (*OpenBazaarService).handleOrderConfirmation() is high (> 15) (gocyclo)
    • Line 1946: warning: cyclomatic complexity 23 of function (*OpenBazaarService).handleOrderPayment() is high (> 15) (gocyclo)
    • Line 1344: warning: cyclomatic complexity 23 of function (*OpenBazaarService).handleDisputeUpdate() is high (> 15) (gocyclo)
    • Line 1030: warning: cyclomatic complexity 23 of function (*OpenBazaarService).handleOrderFulfillment() is high (> 15) (gocyclo)
    • Line 1651: warning: cyclomatic complexity 16 of function (*OpenBazaarService).handleChat() is high (> 15) (gocyclo)
    • mobile/node.go
    • Line 101: warning: cyclomatic complexity 28 of function NewNodeWithConfig() is high (> 15) (gocyclo)
    • Line 371: warning: cyclomatic complexity 21 of function (*Node).start() is high (> 15) (gocyclo)
    • repo/migrations/Migration006_test.go
    • Line 17: warning: cyclomatic complexity 24 of function TestMigration006() is high (> 15) (gocyclo)
    • Line 152: warning: cyclomatic complexity 16 of function TestMigration006HandlesMissingSettings() is high (> 15) (gocyclo)
    • cmd/start.go
    • Line 95: warning: cyclomatic complexity 117 of function (*Start).Execute() is high (> 15) (gocyclo)
    • core/listings_test.go
    • Line 11: warning: cyclomatic complexity 16 of function TestOpenBazaarNode_SetCurrencyOnListings() is high (> 15) (gocyclo)
    • core/disputes.go
    • Line 251: warning: cyclomatic complexity 61 of function (*OpenBazaarNode).ProcessDisputeOpen() is high (> 15) (gocyclo)
    • Line 485: warning: cyclomatic complexity 57 of function (*OpenBazaarNode).CloseDispute() is high (> 15) (gocyclo)
    • Line 843: warning: cyclomatic complexity 43 of function (*OpenBazaarNode).ValidateCaseContract() is high (> 15) (gocyclo)
    • Line 1107: warning: cyclomatic complexity 29 of function (*OpenBazaarNode).ReleaseFunds() is high (> 15) (gocyclo)
    • Line 50: warning: cyclomatic complexity 17 of function (*OpenBazaarNode).OpenDispute() is high (> 15) (gocyclo)
    • core/completion.go
    • Line 64: warning: cyclomatic complexity 44 of function (*OpenBazaarNode).CompleteOrder() is high (> 15) (gocyclo)
    • Line 307: warning: cyclomatic complexity 22 of function (*OpenBazaarNode).ReleaseFundsAfterTimeout() is high (> 15) (gocyclo)
    • Line 431: warning: cyclomatic complexity 21 of function (*OpenBazaarNode).ValidateAndSaveRating() is high (> 15) (gocyclo)
    • repo/db/chat_test.go
    • Line 234: warning: cyclomatic complexity 34 of function TestChatDB_MarkAsRead() is high (> 15) (gocyclo)
    • Line 122: warning: cyclomatic complexity 22 of function TestChatDB_GetMessages() is high (> 15) (gocyclo)
    • repo/db/cases.go
    • Line 209: warning: cyclomatic complexity 20 of function (*CasesDB).GetAll() is high (> 15) (gocyclo)
    • Line 331: warning: cyclomatic complexity 16 of function (*CasesDB).GetCaseMetadata() is high (> 15) (gocyclo)
    • api/endpoints.go
    • Line 26: warning: cyclomatic complexity 56 of function post() is high (> 15) (gocyclo)
    • Line 144: warning: cyclomatic complexity 45 of function get() is high (> 15) (gocyclo)
    • core/profile.go
    • Line 302: warning: cyclomatic complexity 54 of function ValidateProfile() is high (> 15) (gocyclo)
    • Line 136: warning: cyclomatic complexity 21 of function (*OpenBazaarNode).PatchProfile() is high (> 15) (gocyclo)
    • repo/db/purchases_test.go
    • Line 366: warning: cyclomatic complexity 26 of function TestPurchasesDB_GetAll() is high (> 15) (gocyclo)
    • Line 729: warning: cyclomatic complexity 19 of function TestGetPurchasesForDisputeExpiryNotificationReturnsRelevantRecords() is high (> 15) (gocyclo)
    • Line 524: warning: cyclomatic complexity 17 of function TestGetPurchasesForDisputeTimeoutReturnsRelevantRecords() is high (> 15) (gocyclo)
    • Line 837: warning: cyclomatic complexity 16 of function TestUpdatePurchaseLastDisputeExpiryNotifiedAt() is high (> 15) (gocyclo)
    • Line 635: warning: cyclomatic complexity 16 of function TestUpdatePurchaseLastDisputeTimeoutNotifiedAt() is high (> 15) (gocyclo)
    • core/listings.go
    • Line 128: warning: cyclomatic complexity 23 of function (*OpenBazaarNode).saveListing() is high (> 15) (gocyclo)
    • core/posts.go
    • Line 533: warning: cyclomatic complexity 32 of function validatePost() is high (> 15) (gocyclo)
    • wallet/builder.go
    • Line 128: warning: cyclomatic complexity 21 of function createAPIWallet() is high (> 15) (gocyclo)
    • Line 64: warning: cyclomatic complexity 19 of function NewMultiWallet() is high (> 15) (gocyclo)
    • Line 312: warning: cyclomatic complexity 16 of function prepareAPICoinConfig() is high (> 15) (gocyclo)
    • core/moderation.go
    • Line 151: warning: cyclomatic complexity 21 of function (*OpenBazaarNode).GetModeratorFee() is high (> 15) (gocyclo)
    • Line 55: warning: cyclomatic complexity 20 of function (*OpenBazaarNode).SetSelfAsModerator() is high (> 15) (gocyclo)
    • cmd/restore.go
    • Line 59: warning: cyclomatic complexity 51 of function (*Restore).Execute() is high (> 15) (gocyclo)
    • core/refunds.go
    • Line 18: warning: cyclomatic complexity 24 of function (*OpenBazaarNode).RefundOrder() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words

    • core/record_aging_notifier_test.go
    • Line 78: warning: "fourty" is a misspelling of "forty" (misspell)
    • Line 78: warning: "fourty" is a misspelling of "forty" (misspell)
    • Line 458: warning: "fourty" is a misspelling of "forty" (misspell)
    • Line 458: warning: "fourty" is a misspelling of "forty" (misspell)
    • Line 763: warning: "fourty" is a misspelling of "forty" (misspell)
    • Line 763: warning: "fourty" is a misspelling of "forty" (misspell)