Preparing report...

Report for github.com/songtianyi/wechat-go

A+    Excellent!    Found 16 issues across 30 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo100%

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.

No problems detected. Good job!


golint50%

Golint is a linter for Go source code.

    • wechat-go/wxweb/api.go
    • Line 48: warning: comment on exported function JsLogin should be of the form "JsLogin ..." (golint)
    • Line 75: warning: comment on exported function QrCode should be of the form "QrCode ..." (golint)
    • Line 90: warning: comment on exported function Login should be of the form "Login ..." (golint)
    • Line 117: warning: comment on exported function WebNewLoginPage should be of the form "WebNewLoginPage ..." (golint)
    • Line 138: warning: comment on exported function WebWxInit should be of the form "WebWxInit ..." (golint)
    • Line 171: warning: comment on exported function SyncCheck should be of the form "SyncCheck ..." (golint)
    • Line 236: warning: comment on exported function WebWxSync should be of the form "WebWxSync ..." (golint)
    • Line 303: warning: exported function WebWxSyncFlushCookie should have comment or be unexported (golint)
    • Line 361: warning: comment on exported function WebWxStatusNotify should be of the form "WebWxStatusNotify ..." (golint)
    • Line 398: warning: comment on exported function WebWxGetContact should be of the form "WebWxGetContact ..." (golint)
    • Line 436: warning: comment on exported function WebWxSendMsg should be of the form "WebWxSendMsg ..." (golint)
    • Line 483: warning: comment on exported function WebWxUploadMedia should be of the form "WebWxUploadMedia ..." (golint)
    • Line 587: warning: comment on exported function WebWxSendMsgImg should be of the form "WebWxSendMsgImg ..." (golint)
    • Line 641: warning: comment on exported function WebWxGetMsgImg should be of the form "WebWxGetMsgImg ..." (golint)
    • Line 669: warning: comment on exported function WebWxSendEmoticon should be of the form "WebWxSendEmoticon ..." (golint)
    • Line 721: warning: comment on exported function WebWxGetIcon should be of the form "WebWxGetIcon ..." (golint)
    • Line 753: warning: comment on exported function WebWxGetIconByHeadImgUrl should be of the form "WebWxGetIconByHeadImgUrl ..." (golint)
    • Line 777: warning: comment on exported function WebWxBatchGetContact should be of the form "WebWxBatchGetContact ..." (golint)
    • Line 816: warning: comment on exported function WebWxVerifyUser should be of the form "WebWxVerifyUser ..." (golint)
    • Line 846: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 861: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 872: warning: comment on exported function WebWxCreateChatroom should be of the form "WebWxCreateChatroom ..." (golint)
    • Line 911: warning: comment on exported function WebWxRevokeMsg should be of the form "WebWxRevokeMsg ..." (golint)
    • Line 957: warning: comment on exported function WebWxLogout should be of the form "WebWxLogout ..." (golint)
    • wechat-go/wxweb/handler.go
    • Line 33: warning: comment on exported type Handler should be of the form "Handler ..." (with optional leading article) (golint)
    • Line 36: warning: comment on exported type HandlerWrapper should be of the form "HandlerWrapper ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported method HandlerWrapper.Run should be of the form "Run ..." (golint)
    • Line 54: warning: comment on exported method HandlerWrapper.GetName should be of the form "GetName ..." (golint)
    • Line 59: warning: comment on exported method HandlerWrapper.GetEnabled should be of the form "GetEnabled ..." (golint)
    • Line 74: warning: comment on exported type HandlerRegister should be of the form "HandlerRegister ..." (with optional leading article) (golint)
    • Line 80: warning: comment on exported function CreateHandlerRegister should be of the form "CreateHandlerRegister ..." (golint)
    • Line 87: warning: comment on exported method HandlerRegister.Add should be of the form "Add ..." (golint)
    • Line 102: warning: comment on exported method HandlerRegister.Get should be of the form "Get ..." (golint)
    • Line 103: warning: error should be the last type when returning multiple items (golint)
    • Line 112: warning: comment on exported method HandlerRegister.GetAll should be of the form "GetAll ..." (golint)
    • Line 123: warning: comment on exported method HandlerRegister.EnableByType should be of the form "EnableByType ..." (golint)
    • Line 138: warning: comment on exported method HandlerRegister.DisableByType should be of the form "DisableByType ..." (golint)
    • Line 153: warning: comment on exported method HandlerRegister.EnableByName should be of the form "EnableByName ..." (golint)
    • Line 168: warning: comment on exported method HandlerRegister.DisableByName should be of the form "DisableByName ..." (golint)
    • Line 183: warning: comment on exported method HandlerRegister.Dump should be of the form "Dump ..." (golint)
    • wechat-go/wxweb/member.go
    • Line 33: warning: comment on exported type MemberManager should be of the form "MemberManager ..." (with optional leading article) (golint)
    • Line 38: warning: comment on exported function CreateMemberManagerFromGroupContact should be of the form "CreateMemberManagerFromGroupContact ..." (golint)
    • Line 50: warning: comment on exported function CreateMemberManagerFromBytes should be of the form "CreateMemberManagerFromBytes ..." (golint)
    • Line 72: warning: comment on exported method MemberManager.Update should be of the form "Update ..." (golint)
    • Line 94: warning: comment on exported method MemberManager.GetHeadImgUrlsByGender should be of the form "GetHeadImgUrlsByGender ..." (golint)
    • Line 105: warning: comment on exported method MemberManager.GetContactsByGender should be of the form "GetContactsByGender ..." (golint)
    • Line 116: warning: comment on exported method MemberManager.GetContactByUserName should be of the form "GetContactByUserName ..." (golint)
    • wechat-go/wxweb/utils.go
    • Line 38: warning: exported function GetRandomStringFromNum should have comment or be unexported (golint)
    • Line 48: warning: exported function GetSyncKeyListFromJc should have comment or be unexported (golint)
    • Line 69: warning: exported function GetUserInfoFromJc should have comment or be unexported (golint)
    • Line 84: warning: exported function RealTargetUserName should have comment or be unexported (golint)
    • Line 91: warning: exported function GetLoginAvatar should have comment or be unexported (golint)
    • wechat-go/wxweb/contact.go
    • Line 34: warning: comment on exported var SpecialContact should be of the form "SpecialContact ..." (golint)
    • Line 67: warning: comment on exported type ContactManager should be of the form "ContactManager ..." (with optional leading article) (golint)
    • Line 72: warning: comment on exported function CreateContactManagerFromBytes should be of the form "CreateContactManagerFromBytes ..." (golint)
    • Line 85: warning: comment on exported method ContactManager.AddUserFromBytes should be of the form "AddUserFromBytes ..." (golint)
    • Line 96: warning: comment on exported method ContactManager.AddUser should be of the form "AddUser ..." (golint)
    • Line 104: warning: comment on exported method ContactManager.GetContactByUserName should be of the form "GetContactByUserName ..." (golint)
    • Line 115: warning: comment on exported method ContactManager.GetGroupContacts should be of the form "GetGroupContacts ..." (golint)
    • Line 126: warning: comment on exported method ContactManager.GetStrangers should be of the form "GetStrangers ..." (golint)
    • Line 140: warning: comment on exported method ContactManager.GetContactsByName should be of the form "GetContactsByName ..." (golint)
    • Line 151: warning: comment on exported method ContactManager.GetContactByPYQuanPin should be of the form "GetContactByPYQuanPin ..." (golint)
    • Line 161: warning: comment on exported method ContactManager.GetAll should be of the form "GetAll ..." (golint)
    • wechat-go/wxweb/http.go
    • Line 15: warning: exported type Client should have comment or be unexported (golint)
    • Line 20: warning: exported type Header should have comment or be unexported (golint)
    • Line 22: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 42: warning: exported method Client.SetJar should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 51: warning: exported method Client.GetByte should have comment or be unexported (golint)
    • Line 55: warning: exported method Client.GetWithHeader should have comment or be unexported (golint)
    • Line 60: warning: exported method Client.Post should have comment or be unexported (golint)
    • Line 64: warning: exported method Client.PostJson should have comment or be unexported (golint)
    • Line 71: warning: exported method Client.PostJsonByte should have comment or be unexported (golint)
    • Line 75: warning: exported method Client.PostJsonByteForResp should have comment or be unexported (golint)
    • wechat-go/wxweb/psession.go
    • Line 11: warning: exported type PSession should have comment or be unexported (golint)
    • Line 22: warning: exported function WriteSessionData should have comment or be unexported (golint)
    • Line 62: warning: exported function ReadSessionData should have comment or be unexported (golint)
    • wechat-go/kv/memory.go
    • Line 8: warning: exported var KVStorageInstance should have comment or be unexported (golint)
    • Line 17: warning: exported type KVStorage should have comment or be unexported (golint)
    • Line 23: warning: exported method KVStorage.Put should have comment or be unexported (golint)
    • Line 29: warning: exported method KVStorage.Get should have comment or be unexported (golint)
    • wechat-go/wxweb/common.go
    • Line 35: warning: comment on exported const MSG_TEXT should be of the form "MSG_TEXT ..." (golint)
    • Line 37: warning: exported const MSG_IMG should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: comment on exported type Common should be of the form "Common ..." (with optional leading article) (golint)
    • Line 72: warning: exported type UrlGroup should have comment or be unexported (golint)
    • Line 78: warning: comment on exported type InitReqBody should be of the form "InitReqBody ..." (with optional leading article) (golint)
    • Line 108: warning: comment on exported type RevokeReqBody should be of the form "RevokeReqBody ..." (with optional leading article) (golint)
    • Line 116: warning: comment on exported type LogoutReqBody should be of the form "LogoutReqBody ..." (with optional leading article) (golint)
    • Line 122: warning: comment on exported type BaseRequest should be of the form "BaseRequest ..." (with optional leading article) (golint)
    • Line 130: warning: comment on exported type XmlConfig should be of the form "XmlConfig ..." (with optional leading article) (golint)
    • Line 142: warning: comment on exported type SyncKey should be of the form "SyncKey ..." (with optional leading article) (golint)
    • Line 148: warning: comment on exported type SyncKeyList should be of the form "SyncKeyList ..." (with optional leading article) (golint)
    • Line 163: warning: comment on exported type User should be of the form "User ..." (with optional leading article) (golint)
    • Line 201: warning: comment on exported type TextMessage should be of the form "TextMessage ..." (with optional leading article) (golint)
    • Line 211: warning: comment on exported type MediaMessage should be of the form "MediaMessage ..." (with optional leading article) (golint)
    • Line 222: warning: comment on exported type EmotionMessage should be of the form "EmotionMessage ..." (with optional leading article) (golint)
    • Line 233: warning: comment on exported type BaseResponse should be of the form "BaseResponse ..." (with optional leading article) (golint)
    • Line 239: warning: comment on exported type WxWebGetContactResponse should be of the form "WxWebGetContactResponse ..." (with optional leading article) (golint)
    • Line 247: warning: comment on exported type WxWebBatchGetContactResponse should be of the form "WxWebBatchGetContactResponse ..." (with optional leading article) (golint)
    • Line 254: warning: comment on exported type VerifyUser should be of the form "VerifyUser ..." (with optional leading article) (golint)
    • Line 260: warning: exported type RecommendInfo should have comment or be unexported (golint)
    • Line 277: warning: comment on exported type ReceivedMessage should be of the form "ReceivedMessage ..." (with optional leading article) (golint)
    • wechat-go/wxweb/apiv2.go
    • Line 48: warning: exported type ApiV2 should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method ApiV2.JsLogin should be of the form "JsLogin ..." (golint)
    • Line 72: warning: comment on exported method ApiV2.QrCode should be of the form "QrCode ..." (golint)
    • Line 82: warning: comment on exported method ApiV2.Login should be of the form "Login ..." (golint)
    • Line 105: warning: comment on exported method ApiV2.WebNewLoginPage should be of the form "WebNewLoginPage ..." (golint)
    • Line 122: warning: comment on exported method ApiV2.WebWxInit should be of the form "WebWxInit ..." (golint)
    • Line 147: warning: comment on exported method ApiV2.SyncCheck should be of the form "SyncCheck ..." (golint)
    • Line 191: warning: comment on exported method ApiV2.WebWxSync should be of the form "WebWxSync ..." (golint)
    • Line 242: warning: exported method ApiV2.WebWxSyncFlushCookie should have comment or be unexported (golint)
    • Line 289: warning: comment on exported method ApiV2.WebWxStatusNotify should be of the form "WebWxStatusNotify ..." (golint)
    • Line 317: warning: comment on exported method ApiV2.WebWxGetContact should be of the form "WebWxGetContact ..." (golint)
    • Line 344: warning: comment on exported method ApiV2.WebWxSendMsg should be of the form "WebWxSendMsg ..." (golint)
    • Line 380: warning: comment on exported method ApiV2.WebWxUploadMedia should be of the form "WebWxUploadMedia ..." (golint)
    • Line 474: warning: comment on exported method ApiV2.WebWxSendMsgImg should be of the form "WebWxSendMsgImg ..." (golint)
    • Line 517: warning: comment on exported method ApiV2.WebWxGetMsgImg should be of the form "WebWxGetMsgImg ..." (golint)
    • Line 536: warning: comment on exported method ApiV2.WebWxSendEmoticon should be of the form "WebWxSendEmoticon ..." (golint)
    • Line 588: warning: comment on exported method ApiV2.WebWxGetIcon should be of the form "WebWxGetIcon ..." (golint)
    • Line 620: warning: comment on exported method ApiV2.WebWxGetIconByHeadImgUrl should be of the form "WebWxGetIconByHeadImgUrl ..." (golint)
    • Line 644: warning: comment on exported method ApiV2.WebWxBatchGetContact should be of the form "WebWxBatchGetContact ..." (golint)
    • Line 683: warning: exported type ChatroomReqBody should have comment or be unexported (golint)
    • Line 689: warning: comment on exported method ApiV2.WxUpdateChatroom should be of the form "WxUpdateChatroom ..." (golint)
    • Line 690: warning: receiver name a should be consistent with previous receiver name api for ApiV2 (golint)
    • Line 718: warning: comment on exported method ApiV2.WebWxVerifyUser should be of the form "WebWxVerifyUser ..." (golint)
    • Line 754: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 764: warning: comment on exported method ApiV2.WebWxCreateChatroom should be of the form "WebWxCreateChatroom ..." (golint)
    • Line 803: warning: comment on exported method ApiV2.WebWxRevokeMsg should be of the form "WebWxRevokeMsg ..." (golint)
    • Line 849: warning: comment on exported method ApiV2.WebWxLogout should be of the form "WebWxLogout ..." (golint)
    • Line 879: warning: exported function NewApiV2 should have comment or be unexported (golint)
    • wechat-go/wxweb/session.go
    • Line 44: warning: comment on exported const WEB_MODE should be of the form "WEB_MODE ..." (golint)
    • Line 46: warning: comment on exported const TERMINAL_MODE should be of the form "TERMINAL_MODE ..." (golint)
    • Line 49: warning: exported const BACKGROUND_MODE should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: comment on exported var DefaultCommon should be of the form "DefaultCommon ..." (golint)
    • Line 65: warning: exported var URLPool should have comment or be unexported (golint)
    • Line 82: warning: comment on exported type Session should be of the form "Session ..." (with optional leading article) (golint)
    • Line 101: warning: comment on exported function CreateSession should be of the form "CreateSession ..." (golint)
    • Line 167: warning: exported function CreateWebSessionWithPath should have comment or be unexported (golint)
    • Line 167: warning: don't use underscores in Go names; func parameter qrcode_path should be qrcodePath (golint)
    • Line 253: warning: exported method Session.SetCookies should have comment or be unexported (golint)
    • Line 259: warning: comment on exported method Session.LoginAndServe should be of the form "LoginAndServe ..." (golint)
    • Line 327: warning: exported method Session.SetAfterLogin should have comment or be unexported (golint)
    • Line 331: warning: exported method Session.SetOnLoginAvatar should have comment or be unexported (golint)
    • Line 491: warning: comment on exported method Session.After should be of the form "After ..." (golint)
    • Line 499: warning: exported method Session.At should have comment or be unexported (golint)
    • Line 503: warning: comment on exported method Session.SendText should be of the form "SendText ..." (golint)
    • Line 520: warning: comment on exported method Session.SendImg should be of the form "SendImg ..." (golint)
    • Line 540: warning: comment on exported method Session.SendImgFromBytes should be of the form "SendImgFromBytes ..." (golint)
    • Line 555: warning: comment on exported method Session.GetImg should be of the form "GetImg ..." (golint)
    • Line 560: warning: comment on exported method Session.SendEmotionFromPath should be of the form "SendEmotionFromPath ..." (golint)
    • Line 579: warning: comment on exported method Session.SendEmotionFromBytes should be of the form "SendEmotionFromBytes ..." (golint)
    • Line 592: warning: comment on exported method Session.RevokeMsg should be of the form "RevokeMsg ..." (golint)
    • Line 600: warning: exported method Session.GetCookies should have comment or be unexported (golint)
    • Line 606: warning: comment on exported method Session.Logout should be of the form "Logout ..." (golint)
    • Line 612: warning: exported method Session.AcceptFriend should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • wechat-go/wxweb/api.go
    • Line 58: warning: ineffectual assignment to err (ineffassign)
    • Line 158: warning: ineffectual assignment to err (ineffassign)
    • Line 264: warning: ineffectual assignment to err (ineffassign)
    • Line 330: warning: ineffectual assignment to err (ineffassign)
    • Line 383: warning: ineffectual assignment to err (ineffassign)

misspell93%

Misspell Finds commonly misspelled English words