Preparing report...

Report for github.com/cbeuw/Cloak

(v1.1.2)

A    Great!    Found 31 issues across 36 files

Tweet

gofmt72%

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!


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.

    • cmd/ck-server/ck-server.go
    • Line 43: warning: cyclomatic complexity 25 of function dispatchConnection() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 16 of function main() is high (> 15) (gocyclo)

golint36%

Golint is a linter for Go source code.

    • cmd/ck-server/ck-server.go
    • Line 156: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 166: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • internal/server/usermanager/controller.go
    • Line 43: warning: exported method Userpanel.MakeController should have comment or be unexported (golint)
    • Line 53: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 168: warning: exported var ErrInvalidMac should have comment or be unexported (golint)
    • internal/multiplex/session.go
    • Line 16: warning: exported var ErrBrokenSession should have comment or be unexported (golint)
    • Line 19: warning: exported type Session should have comment or be unexported (golint)
    • Line 46: warning: exported function MakeSession should have comment or be unexported (golint)
    • Line 62: warning: exported method Session.AddConnection should have comment or be unexported (golint)
    • Line 66: warning: exported method Session.OpenStream should have comment or be unexported (golint)
    • Line 82: warning: exported method Session.AcceptStream should have comment or be unexported (golint)
    • Line 110: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 116: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 127: warning: exported method Session.Close should have comment or be unexported (golint)
    • Line 147: warning: exported method Session.IsBroken should have comment or be unexported (golint)
    • internal/ecdh/curve25519.go
    • Line 38: warning: exported function GenerateKey should have comment or be unexported (golint)
    • Line 56: warning: exported function Marshal should have comment or be unexported (golint)
    • Line 61: warning: exported function Unmarshal should have comment or be unexported (golint)
    • Line 71: warning: exported function GenerateSharedSecret should have comment or be unexported (golint)
    • internal/multiplex/switchboard.go
    • Line 26: 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 53: warning: exported var ErrNoRxCredit should have comment or be unexported (golint)
    • Line 54: warning: exported var ErrNoTxCredit should have comment or be unexported (golint)
    • cmd/ck-client/admin.go
    • Line 26: warning: exported type UserInfo should have comment or be unexported (golint)
    • Line 259: warning: exported var ErrInvalidMac should have comment or be unexported (golint)
    • internal/util/util.go
    • Line 14: warning: exported function AESEncrypt should have comment or be unexported (golint)
    • Line 22: warning: exported function AESDecrypt should have comment or be unexported (golint)
    • internal/server/usermanager/user.go
    • Line 13: warning: comment on exported type UserInfo should be of the form "UserInfo ..." (with optional leading article) (golint)
    • Line 25: warning: exported type User should have comment or be unexported (golint)
    • Line 38: warning: exported function MakeUser should have comment or be unexported (golint)
    • Line 69: warning: exported method User.DelSession should have comment or be unexported (golint)
    • Line 80: warning: exported method User.GetSession should have comment or be unexported (golint)
    • Line 88: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • internal/multiplex/frameSorter.go
    • Line 80: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 122: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • internal/client/state.go
    • Line 45: warning: exported function InitState should have comment or be unexported (golint)
    • Line 57: warning: exported method State.SetSessionID should have comment or be unexported (golint)
    • internal/server/usermanager/userpanel.go
    • Line 15: warning: exported var Uint32 should have comment or be unexported (golint)
    • Line 16: warning: exported var Uint64 should have comment or be unexported (golint)
    • Line 17: warning: exported var PutUint16 should have comment or be unexported (golint)
    • Line 18: warning: exported var PutUint32 should have comment or be unexported (golint)
    • Line 19: warning: exported var PutUint64 should have comment or be unexported (golint)
    • Line 21: warning: exported type Userpanel should have comment or be unexported (golint)
    • Line 29: warning: exported function MakeUserpanel should have comment or be unexported (golint)
    • Line 99: warning: exported var ErrUserNotFound should have comment or be unexported (golint)
    • Line 100: warning: exported var ErrUserNotActive should have comment or be unexported (golint)
    • Line 102: warning: exported method Userpanel.GetAndActivateAdminUser should have comment or be unexported (golint)
    • Line 127: warning: comment on exported method Userpanel.GetAndActivateUser should be of the form "GetAndActivateUser ..." (golint)
    • internal/multiplex/obfs.go
    • Line 11: warning: exported type Obfser should have comment or be unexported (golint)
    • Line 12: warning: exported type Deobfser should have comment or be unexported (golint)
    • Line 26: warning: exported function MakeObfs should have comment or be unexported (golint)
    • Line 51: warning: exported function MakeDeobfs should have comment or be unexported (golint)
    • internal/multiplex/qos.go
    • Line 24: warning: exported function MakeValve should have comment or be unexported (golint)
    • Line 34: warning: exported method Valve.SetRxRate should have comment or be unexported (golint)
    • Line 35: warning: exported method Valve.SetTxRate should have comment or be unexported (golint)
    • Line 38: warning: exported method Valve.SetRxCredit should have comment or be unexported (golint)
    • Line 39: warning: exported method Valve.SetTxCredit should have comment or be unexported (golint)
    • Line 40: warning: exported method Valve.GetRxCredit should have comment or be unexported (golint)
    • Line 41: warning: exported method Valve.GetTxCredit should have comment or be unexported (golint)
    • Line 43: warning: comment on exported method Valve.AddRxCredit should be of the form "AddRxCredit ..." (golint)
    • Line 46: warning: comment on exported method Valve.AddTxCredit should be of the form "AddTxCredit ..." (golint)
    • internal/multiplex/stream.go
    • Line 12: warning: exported var ErrBrokenStream should have comment or be unexported (golint)
    • Line 14: warning: exported type Stream should have comment or be unexported (golint)
    • Line 119: warning: comment on exported method Stream.Close should be of the form "Close ..." (golint)
    • internal/client/auth.go
    • Line 19: warning: exported function MakeRandomField should have comment or be unexported (golint)
    • Line 36: warning: exported function MakeSessionTicket should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign86%

IneffAssign detects ineffectual assignments in Go code.


misspell88%

Misspell Finds commonly misspelled English words