Preparing report...

Report for github.com/ottemo/commerce

A    Great!    Found 181 issues across 485 files

Tweet

gofmt78%

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!


gocyclo83%

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.

    • commerce/app/actors/rts/api.go
    • Line 422: warning: cyclomatic complexity 18 of function APIGetBestsellers() is high (> 15) (gocyclo)
    • Line 331: warning: cyclomatic complexity 16 of function APIGetSalesDetails() is high (> 15) (gocyclo)
    • Line 129: warning: cyclomatic complexity 16 of function APIGetVisitsDetails() is high (> 15) (gocyclo)
    • commerce/impex/commands.go
    • Line 600: warning: cyclomatic complexity 37 of function (*ImportCmdMedia).Process() is high (> 15) (gocyclo)
    • Line 764: warning: cyclomatic complexity 16 of function (*ImportCmdAttributeAdd).Init() is high (> 15) (gocyclo)
    • commerce/app/actors/checkout/api.go
    • Line 527: warning: cyclomatic complexity 47 of function APISubmitCheckout() is high (> 15) (gocyclo)
    • Line 209: warning: cyclomatic complexity 16 of function checkoutObtainAddress() is high (> 15) (gocyclo)
    • Line 422: warning: cyclomatic complexity 16 of function checkoutObtainToken() is high (> 15) (gocyclo)
    • commerce/app/actors/product/api.go
    • Line 767: warning: cyclomatic complexity 19 of function APIListProducts() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 18 of function APIUpdateProductAttribute() is high (> 15) (gocyclo)
    • Line 227: warning: cyclomatic complexity 16 of function APICreateProductAttribute() is high (> 15) (gocyclo)
    • commerce/impex/csv.go
    • Line 158: warning: cyclomatic complexity 66 of function CSVToMap() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 31 of function MapToCSV() is high (> 15) (gocyclo)
    • Line 526: warning: cyclomatic complexity 25 of function ImportCSVData() is high (> 15) (gocyclo)
    • commerce/utils/datatypes.go
    • Line 302: warning: cyclomatic complexity 24 of function InterfaceToArray() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 19 of function IsMD5() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 16 of function InterfaceToStringArray() is high (> 15) (gocyclo)
    • commerce/db/sqlite/collection.i_dbcollection.go
    • Line 183: warning: cyclomatic complexity 21 of function (*DBCollection).Save() is high (> 15) (gocyclo)
    • Line 546: warning: cyclomatic complexity 18 of function (*DBCollection).RemoveColumn() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 16 of function (*DBCollection).Distinct() is high (> 15) (gocyclo)
    • commerce/app/actors/visitor/api.go
    • Line 169: warning: cyclomatic complexity 24 of function APIUpdateVisitor() is high (> 15) (gocyclo)
    • Line 851: warning: cyclomatic complexity 24 of function APIFacebookLogin() is high (> 15) (gocyclo)
    • Line 965: warning: cyclomatic complexity 20 of function APIGoogleLogin() is high (> 15) (gocyclo)
    • Line 432: warning: cyclomatic complexity 18 of function APIUpdateVisitorAttribute() is high (> 15) (gocyclo)

golint92%

Golint is a linter for Go source code.

    • commerce/main.go
    • Line 34: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)
    • commerce/app/actors/other/shipstation/decl.go
    • Line 6: warning: exported const ConstErrorModule should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: comment on exported type Orders should be of the form "Orders ..." (with optional leading article) (golint)
    • Line 15: warning: exported type Order should have comment or be unexported (golint)
    • Line 30: warning: exported type Customer should have comment or be unexported (golint)
    • Line 38: warning: exported type BillingAddress should have comment or be unexported (golint)
    • Line 42: warning: exported type ShippingAddress should have comment or be unexported (golint)
    • Line 51: warning: exported type OrderItem should have comment or be unexported (golint)
    • commerce/app/models/stock/helpers.go
    • Line 9: warning: comment on exported function GetStockModel should be of the form "GetStockModel ..." (golint)
    • Line 24: warning: comment on exported function GetStockCollectionModel should be of the form "GetStockCollectionModel ..." (golint)
    • commerce/media/fsmedia/api.go
    • Line 19: warning: exported function APIGetMedia should have comment or be unexported (golint)
    • Line 48: warning: comment on exported function APIResizeAll should be of the form "APIResizeAll ..." (golint)
    • commerce/utils/sync.go
    • Line 177: warning: comment on exported function SyncScalarLock should be of the form "SyncScalarLock ..." (golint)
    • Line 185: warning: comment on exported function SyncScalarUnlock should be of the form "SyncScalarUnlock ..." (golint)
    • commerce/api/session/service.go
    • Line 42: warning: exported method DefaultSessionContainer.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method DefaultSessionContainer.Get should have comment or be unexported (golint)
    • Line 57: warning: exported method DefaultSessionContainer.GetUpdatedAt should have comment or be unexported (golint)
    • Line 63: warning: exported method DefaultSessionContainer.SetUpdatedAt should have comment or be unexported (golint)
    • Line 69: warning: exported method DefaultSessionContainer.GetID should have comment or be unexported (golint)
    • Line 75: warning: exported method DefaultSessionContainer.SetID should have comment or be unexported (golint)
    • commerce/app/actors/other/vantagepoint/actors/uploadsprocessor.go
    • Line 10: warning: exported type FileNameInterface should have comment or be unexported (golint)
    • Line 15: warning: exported type EnvInterface should have comment or be unexported (golint)
    • Line 25: warning: exported type StorageInterface should have comment or be unexported (golint)
    • Line 31: warning: exported type DataProcessorInterface should have comment or be unexported (golint)
    • Line 37: warning: exported type FileNamesSorter should have comment or be unexported (golint)
    • Line 76: warning: exported function NewUploadsProcessor should have comment or be unexported (golint)
    • commerce/app/actors/other/vantagepoint/internal.go
    • Line 50: warning: receiver name it should be consistent with previous receiver name c for fileNameType (golint)
    • Line 61: warning: receiver name it should be consistent with previous receiver name c for fileNameType (golint)
    • Line 77: warning: exported function CheckNewUploads should have comment or be unexported (golint)
    • commerce/app/actors/other/vantagepoint/actors/diskstorage.go
    • Line 11: warning: exported type Disk should have comment or be unexported (golint)
    • Line 16: warning: exported function NewDiskStorage should have comment or be unexported (golint)
    • Line 25: warning: exported method Disk.ListFiles should have comment or be unexported (golint)
    • Line 42: warning: exported method Disk.Archive should have comment or be unexported (golint)
    • Line 80: warning: exported method Disk.GetReadCloser should have comment or be unexported (golint)
    • Line 89: warning: receiver name s should be consistent with previous receiver name it for Disk (golint)
    • commerce/app/actors/stock/i_stock.go
    • Line 499: warning: don't use underscores in Go names; method parameter product_id should be productID (golint)
    • Line 520: warning: comment on exported method DefaultStock.SetQty should be of the form "SetQty ..." (golint)
    • Line 526: warning: comment on exported method DefaultStock.GetQty should be of the form "GetQty ..." (golint)
    • commerce/app/actors/cart/i_cart.go
    • Line 284: warning: exported method DefaultCart.SetCustomInfo should have comment or be unexported (golint)
    • Line 287: warning: exported method DefaultCart.GetCustomInfo should have comment or be unexported (golint)
    • commerce/app/actors/other/vantagepoint/actors/uploadsprocessor_test.go
    • Line 69: warning: receiver name it should be consistent with previous receiver name e for testEnv (golint)
    • Line 73: warning: receiver name it should be consistent with previous receiver name e for testEnv (golint)
    • Line 77: warning: receiver name it should be consistent with previous receiver name e for testEnv (golint)
    • Line 81: warning: receiver name it should be consistent with previous receiver name e for testEnv (golint)
    • commerce/app/actors/shipping/flatweight/decl.go
    • Line 10: warning: exported const ConstShippingCode should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Rates should have comment or be unexported (golint)
    • Line 31: warning: exported type Rate should have comment or be unexported (golint)
    • commerce/utils/generic.go
    • Line 320: warning: comment on exported function StrToSnakeCase should be of the form "StrToSnakeCase ..." (golint)
    • Line 328: warning: comment on exported function StrToCamelCase should be of the form "StrToCamelCase ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words

    • commerce/utils/rounding_test.go
    • Line 9: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 12: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 16: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 19: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 23: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 26: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 30: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 33: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 37: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 40: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 44: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 47: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 51: warning: "incorect" is a misspelling of "incorrect" (misspell)
    • Line 54: warning: "incorect" is a misspelling of "incorrect" (misspell)