Preparing report...

Report for github.com/andrewlee302/distributed-system

A+    Excellent!    Found 20 issues across 35 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!


golint68%

Golint is a linter for Go source code.

    • distributed-system/util/dail_rpc.go
    • Line 10: warning: exported function DialServer should have comment or be unexported (golint)
    • Line 23: warning: comment on exported var RPCCallNs should be of the form "RPCCallNs ..." (golint)
    • Line 26: warning: exported function RPCPoolCall should have comment or be unexported (golint)
    • Line 44: warning: exported function RPCPoolArrayCall should have comment or be unexported (golint)
    • distributed-system/util/resouce_pool.go
    • Line 12: warning: exported type Resource should have comment or be unexported (golint)
    • Line 16: warning: exported type ResourcePool should have comment or be unexported (golint)
    • Line 25: warning: exported function NewResourcePool should have comment or be unexported (golint)
    • Line 67: warning: comment on exported method ResourcePool.Clean should be of the form "Clean ..." (golint)
    • Line 74: warning: exported type ResourcePoolsArray should have comment or be unexported (golint)
    • Line 78: warning: exported function NewResourcePoolsArray should have comment or be unexported (golint)
    • Line 86: warning: exported method ResourcePoolsArray.Get should have comment or be unexported (golint)
    • Line 90: warning: exported method ResourcePoolsArray.Put should have comment or be unexported (golint)
    • Line 94: warning: exported method ResourcePoolsArray.Clean should have comment or be unexported (golint)
    • Line 98: warning: exported type ResourcePoolsMap should have comment or be unexported (golint)
    • Line 105: warning: exported function NewResourcePoolsMap should have comment or be unexported (golint)
    • Line 110: warning: exported method ResourcePoolsMap.Get should have comment or be unexported (golint)
    • Line 121: warning: exported method ResourcePoolsMap.Put should have comment or be unexported (golint)
    • Line 131: warning: exported method ResourcePoolsMap.Clean should have comment or be unexported (golint)
    • distributed-system/shopping/common.go
    • Line 12: warning: exported type Item should have comment or be unexported (golint)
    • Line 18: warning: exported type LoginJson should have comment or be unexported (golint)
    • Line 23: warning: exported type Order should have comment or be unexported (golint)
    • Line 31: warning: exported type ItemCount should have comment or be unexported (golint)
    • Line 42: warning: exported type CartIDJson should have comment or be unexported (golint)
    • Line 46: warning: exported type OrderIDJson should have comment or be unexported (golint)
    • Line 50: warning: exported type UserIDAndPass should have comment or be unexported (golint)
    • Line 67: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • distributed-system/tinykv/client.go
    • Line 12: warning: exported type Client should have comment or be unexported (golint)
    • Line 17: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 29: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 37: warning: exported method Client.Put should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.Incr should have comment or be unexported (golint)
    • Line 53: warning: exported method Client.Del should have comment or be unexported (golint)
    • Line 61: warning: exported method Client.Close should have comment or be unexported (golint)
    • distributed-system/shopping/benchmark/stress.go
    • Line 30: warning: comment on exported type Worker should be of the form "Worker ..." (with optional leading article) (golint)
    • Line 40: warning: exported type Context should have comment or be unexported (golint)
    • Line 48: warning: exported type TimeInterval should have comment or be unexported (golint)
    • Line 54: warning: exported type Reporter should have comment or be unexported (golint)
    • Line 75: warning: comment on exported type User should be of the form "User ..." (with optional leading article) (golint)
    • Line 85: warning: exported type Item should have comment or be unexported (golint)
    • Line 91: warning: comment on exported type RequestLogin should be of the form "RequestLogin ..." (with optional leading article) (golint)
    • Line 99: warning: exported type RequestCartAddItem should have comment or be unexported (golint)
    • Line 104: warning: exported type RequestMakeOrder should have comment or be unexported (golint)
    • Line 108: warning: exported type RequestPayOrder should have comment or be unexported (golint)
    • Line 112: warning: comment on exported type ResponseLogin should be of the form "ResponseLogin ..." (with optional leading article) (golint)
    • Line 121: warning: exported type ResponseGetItems should have comment or be unexported (golint)
    • Line 123: warning: exported type ResponseCreateCart should have comment or be unexported (golint)
    • Line 127: warning: exported type ResponseMakeOrder should have comment or be unexported (golint)
    • Line 131: warning: exported type ResponsePayOrder should have comment or be unexported (golint)
    • Line 135: warning: exported type ResponseQueryOrder should have comment or be unexported (golint)
    • Line 154: warning: comment on exported function LoadData should be of the form "LoadData ..." (golint)
    • Line 167: warning: comment on exported function LoadUsers should be of the form "LoadUsers ..." (golint)
    • Line 189: warning: comment on exported function LoadItems should be of the form "LoadItems ..." (golint)
    • Line 206: warning: comment on exported method Worker.Url should be of the form "Url ..." (golint)
    • Line 293: warning: comment on exported function GetRandItem should be of the form "GetRandItem ..." (golint)
    • Line 308: warning: comment on exported method Context.UrlWithToken should be of the form "UrlWithToken ..." (golint)
    • Line 318: warning: exported method Context.Login should have comment or be unexported (golint)
    • Line 340: warning: exported method Context.GetItems should have comment or be unexported (golint)
    • Line 359: warning: exported method Context.CreateCart should have comment or be unexported (golint)
    • Line 379: warning: exported method Context.CartAddItem should have comment or be unexported (golint)
    • Line 400: warning: exported method Context.MakeOrder should have comment or be unexported (golint)
    • Line 431: warning: exported method Context.PayOrder should have comment or be unexported (golint)
    • Line 455: warning: comment on exported function NewWorker should be of the form "NewWorker ..." (golint)
    • Line 464: warning: exported method Worker.Work should have comment or be unexported (golint)
    • Line 482: warning: comment on exported function NewReporter should be of the form "NewReporter ..." (golint)
    • Line 626: warning: comment on exported function MeanOfMaxFive should be of the form "MeanOfMaxFive ..." (golint)
    • Line 646: warning: exported function MeanOfMinFive should have comment or be unexported (golint)
    • Line 663: warning: exported function Mean should have comment or be unexported (golint)
    • Line 674: warning: exported function MeanFloat64 should have comment or be unexported (golint)
    • Line 678: warning: exported function SumFloat64 should have comment or be unexported (golint)
    • distributed-system/kv/kvstore.go
    • Line 20: warning: exported type GetArgs should have comment or be unexported (golint)
    • Line 24: warning: exported type DelArgs should have comment or be unexported (golint)
    • Line 26: warning: exported type PutArgs should have comment or be unexported (golint)
    • Line 31: warning: exported type IncrArgs should have comment or be unexported (golint)
    • Line 36: warning: exported type Reply should have comment or be unexported (golint)
    • distributed-system/shopping/main/start_service.go
    • Line 39: warning: don't use underscores in Go names; var host_ips should be hostIps (golint)
    • Line 91: warning: don't use underscores in Go names; func parameter host_ips should be hostIps (golint)
    • Line 96: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 97: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)

gocyclo88%

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.

    • distributed-system/paxos/test_test.go
    • Line 373: warning: cyclomatic complexity 19 of function TestForgetMem() is high (> 15) (gocyclo)
    • Line 854: warning: cyclomatic complexity 18 of function TestLots() is high (> 15) (gocyclo)
    • Line 219: warning: cyclomatic complexity 17 of function TestForget() is high (> 15) (gocyclo)

ineffassign88%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell80%

Misspell Finds commonly misspelled English words

    • distributed-system/twopc/coordinator.go
    • Line 3: warning: "transcations" is a misspelling of "transactions" (misspell)
    • Line 17: warning: "essense" is a misspelling of "essence" (misspell)
    • Line 55: warning: "receving" is a misspelling of "receiving" (misspell)
    • Line 57: warning: "receving" is a misspelling of "receiving" (misspell)
    • Line 102: warning: "Coordiantor" is a misspelling of "Coordinator" (misspell)