Preparing report...

Report for github.com/devfeel/longweb

B    Not bad!    Found 28 issues across 29 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!


gocyclo86%

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.


golint3%

Golint is a linter for Go source code.

    • longweb/const/consts.go
    • Line 4: warning: exported const Version should have comment (or a comment on this block) or be unexported (golint)
    • Line 8: warning: don't use underscores in Go names; const GroupID_Online should be GroupIDOnline (golint)
    • Line 8: warning: exported const GroupID_Online should have comment (or a comment on this block) or be unexported (golint)
    • longweb/httpserver/handlers/pollhandler.go
    • Line 6: warning: should not use dot imports (golint)
    • Line 9: warning: should not use dot imports (golint)
    • Line 16: warning: comment on exported function OnPolling should be of the form "OnPolling ..." (golint)
    • Line 188: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 207: 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)
    • longweb/framework/log/logger.go
    • Line 11: warning: exported type ChanLog should have comment or be unexported (golint)
    • Line 24: warning: don't use underscores in Go names; var logChan_Custom should be logChanCustom (golint)
    • Line 35: warning: exported function Debug should have comment or be unexported (golint)
    • Line 39: warning: exported function Info should have comment or be unexported (golint)
    • Line 43: warning: exported function Warn should have comment or be unexported (golint)
    • Line 47: warning: exported function Error should have comment or be unexported (golint)
    • Line 51: warning: exported function Log should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function StartLogHandler should be of the form "StartLogHandler ..." (golint)
    • longweb/message/usergroup.go
    • Line 6: warning: should not use dot imports (golint)
    • Line 14: warning: comment on exported type AppGroups should be of the form "AppGroups ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported type UserGroup should be of the form "UserGroup ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported function GetUserGroup should be of the form "GetUserGroup ..." (golint)
    • Line 42: warning: comment on exported function GetAppGroups should be of the form "GetAppGroups ..." (golint)
    • Line 50: warning: comment on exported function GetState_AppGroups should be of the form "GetState_AppGroups ..." (golint)
    • Line 51: warning: don't use underscores in Go names; func GetState_AppGroups should be GetStateAppGroups (golint)
    • Line 56: warning: comment on exported function NewUserGroup should be of the form "NewUserGroup ..." (golint)
    • Line 61: warning: comment on exported function NewAppGroups should be of the form "NewAppGroups ..." (golint)
    • Line 66: warning: comment on exported function InitAppInfo should be of the form "InitAppInfo ..." (golint)
    • Line 77: warning: comment on exported method AppGroups.GetAndInitUserGroup should be of the form "GetAndInitUserGroup ..." (golint)
    • Line 101: warning: comment on exported method AppGroups.GetGroupCount should be of the form "GetGroupCount ..." (golint)
    • Line 106: warning: comment on exported method AppGroups.GetState_TotalClientCount should be of the form "GetState_TotalClientCount ..." (golint)
    • Line 107: warning: don't use underscores in Go names; method GetState_TotalClientCount should be GetStateTotalClientCount (golint)
    • Line 120: warning: comment on exported method AppGroups.GetState_WebSocketCount should be of the form "GetState_WebSocketCount ..." (golint)
    • Line 121: warning: don't use underscores in Go names; method GetState_WebSocketCount should be GetStateWebSocketCount (golint)
    • Line 134: warning: comment on exported method AppGroups.GetState_AuthWebSocketCount should be of the form "GetState_AuthWebSocketCount ..." (golint)
    • Line 135: warning: don't use underscores in Go names; method GetState_AuthWebSocketCount should be GetStateAuthWebSocketCount (golint)
    • Line 148: warning: comment on exported method AppGroups.GetState_LongPollCount should be of the form "GetState_LongPollCount ..." (golint)
    • Line 149: warning: don't use underscores in Go names; method GetState_LongPollCount should be GetStateLongPollCount (golint)
    • Line 162: warning: comment on exported method AppGroups.GetState_AuthLongPollCount should be of the form "GetState_AuthLongPollCount ..." (golint)
    • Line 163: warning: don't use underscores in Go names; method GetState_AuthLongPollCount should be GetStateAuthLongPollCount (golint)
    • Line 176: warning: comment on exported method AppGroups.GetUserGroup should be of the form "GetUserGroup ..." (golint)
    • Line 177: warning: receiver name ag should be consistent with previous receiver name app for AppGroups (golint)
    • Line 184: warning: comment on exported method AppGroups.GetState_UserGroups should be of the form "GetState_UserGroups ..." (golint)
    • Line 185: warning: receiver name ag should be consistent with previous receiver name app for AppGroups (golint)
    • Line 185: warning: don't use underscores in Go names; method GetState_UserGroups should be GetStateUserGroups (golint)
    • Line 189: warning: comment on exported method AppGroups.SendMessage should be of the form "SendMessage ..." (golint)
    • Line 192: warning: receiver name ag should be consistent with previous receiver name app for AppGroups (golint)
    • Line 204: warning: comment on exported method UserGroup.AddClient should be of the form "AddClient ..." (golint)
    • Line 215: warning: comment on exported method UserGroup.DeleteClient should be of the form "DeleteClient ..." (golint)
    • Line 228: warning: comment on exported method UserGroup.SendMessage should be of the form "SendMessage ..." (golint)
    • Line 300: warning: comment on exported method UserGroup.GetUserClient should be of the form "GetUserClient ..." (golint)
    • Line 311: warning: exported method UserGroup.GetGroupId should have comment or be unexported (golint)
    • Line 315: warning: comment on exported method UserGroup.GetState_WebSocketClientCount should be of the form "GetState_WebSocketClientCount ..." (golint)
    • Line 316: warning: don't use underscores in Go names; method GetState_WebSocketClientCount should be GetStateWebSocketClientCount (golint)
    • Line 320: warning: comment on exported method UserGroup.GetState_AuthWebSocketClientCount should be of the form "GetState_AuthWebSocketClientCount ..." (golint)
    • Line 321: warning: don't use underscores in Go names; method GetState_AuthWebSocketClientCount should be GetStateAuthWebSocketClientCount (golint)
    • Line 333: warning: comment on exported method UserGroup.GetState_LongPollClientCount should be of the form "GetState_LongPollClientCount ..." (golint)
    • Line 334: warning: don't use underscores in Go names; method GetState_LongPollClientCount should be GetStateLongPollClientCount (golint)
    • Line 338: warning: comment on exported method UserGroup.GetState_AuthLongPollClientCount should be of the form "GetState_AuthLongPollClientCount ..." (golint)
    • Line 339: warning: don't use underscores in Go names; method GetState_AuthLongPollClientCount should be GetStateAuthLongPollClientCount (golint)
    • longweb/task/tasks/synconline.go
    • Line 14: warning: exported function Task_SyncOnlineData should have comment or be unexported (golint)
    • Line 14: warning: don't use underscores in Go names; func Task_SyncOnlineData should be TaskSyncOnlineData (golint)
    • longweb/repository/influxdbimpl.go
    • Line 10: warning: exported type InfluxdbImpl should have comment or be unexported (golint)
    • Line 17: warning: exported type InfluxdbData should have comment or be unexported (golint)
    • Line 24: warning: exported function NewInfluxdbData should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method InfluxdbImpl.SetConn should be of the form "SetConn ..." (golint)
    • Line 41: warning: comment on exported method InfluxdbImpl.InsertData should be of the form "InsertData ..." (golint)
    • Line 83: 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)
    • longweb/config/model.go
    • Line 7: warning: comment on exported type AppConfig should be of the form "AppConfig ..." (with optional leading article) (golint)
    • Line 17: warning: comment on exported type HttpServer should be of the form "HttpServer ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported type Log should be of the form "Log ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type AppInfo should be of the form "AppInfo ..." (with optional leading article) (golint)
    • Line 43: warning: exported type SyncNode should have comment or be unexported (golint)
    • Line 47: warning: comment on exported type InfluxdbInfo should be of the form "InfluxdbInfo ..." (with optional leading article) (golint)
    • longweb/message/conndata.go
    • Line 5: warning: exported type AppConnData should have comment or be unexported (golint)
    • Line 13: warning: exported type ConnData should have comment or be unexported (golint)
    • Line 18: warning: exported const OnlineGroupID should have comment or be unexported (golint)
    • Line 20: warning: comment on exported function GetConnData should be of the form "GetConnData ..." (golint)
    • longweb/task/tasks.go
    • Line 10: warning: exported function RegisterTaskHandler should have comment or be unexported (golint)
    • Line 14: warning: exported function StartTaskService should have comment or be unexported (golint)
    • longweb/framework/task/taskmanager.go
    • Line 15: warning: comment on exported type TaskInfo should be of the form "TaskInfo ..." (with optional leading article) (golint)
    • Line 24: warning: exported type TaskHandler should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method TaskInfo.Stop should be of the form "Stop ..." (golint)
    • Line 37: warning: comment on exported method TaskInfo.Start should be of the form "Start ..." (golint)
    • Line 48: warning: comment on exported function NewTask should be of the form "NewTask ..." (golint)
    • Line 57: warning: comment on exported function StopAllTask should be of the form "StopAllTask ..." (golint)
    • Line 67: warning: comment on exported function StartAllTask should be of the form "StartAllTask ..." (golint)
    • Line 77: warning: exported function RegisterTask should have comment or be unexported (golint)
    • Line 83: warning: exported function RemoveTask should have comment or be unexported (golint)
    • Line 93: warning: exported function ReStartAllTask should have comment or be unexported (golint)
    • longweb/httpserver/handlers/defaulthandler.go
    • Line 13: warning: exported function Index should have comment or be unexported (golint)
    • Line 21: warning: exported function Memstate should have comment or be unexported (golint)
    • Line 28: warning: exported function Test should have comment or be unexported (golint)
    • Line 46: warning: exported function TestAuth should have comment or be unexported (golint)
    • Line 71: warning: exported function TestMessage should have comment or be unexported (golint)
    • longweb/framework/json/jsonutil.go
    • Line 7: warning: comment on exported function GetJsonString should be of the form "GetJsonString ..." (golint)
    • Line 16: warning: comment on exported function Marshal should be of the form "Marshal ..." (golint)
    • Line 21: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 26: warning: comment on exported function Unmarshal should be of the form "Unmarshal ..." (golint)
    • longweb/message/consts.go
    • Line 5: warning: don't use underscores in Go names; const ConnType_WebSocket should be ConnTypeWebSocket (golint)
    • Line 6: warning: don't use underscores in Go names; const ConnType_LongPoll should be ConnTypeLongPoll (golint)
    • Line 11: warning: don't use underscores in Go names; const MessageLevel_All should be MessageLevelAll (golint)
    • Line 12: warning: don't use underscores in Go names; const MessageLevel_Normal should be MessageLevelNormal (golint)
    • Line 13: warning: don't use underscores in Go names; const MessageLevel_Auth should be MessageLevelAuth (golint)
    • longweb/exception/exception.go
    • Line 8: warning: exported type Exception should have comment or be unexported (golint)
    • Line 32: warning: comment on exported function CatchError should be of the form "CatchError ..." (golint)
    • longweb/httpserver/server.go
    • Line 11: warning: exported function StartServer should have comment or be unexported (golint)
    • Line 47: warning: exported function ReSetServer should have comment or be unexported (golint)
    • longweb/const/logdefine.go
    • Line 4: warning: don't use underscores in Go names; const LogTarget_Default should be LogTargetDefault (golint)
    • Line 4: warning: exported const LogTarget_Default should have comment (or a comment on this block) or be unexported (golint)
    • Line 5: warning: don't use underscores in Go names; const LogTarget_HttpRequest should be LogTargetHTTPRequest (golint)
    • Line 6: warning: don't use underscores in Go names; const LogTarget_LongPoll should be LogTargetLongPoll (golint)
    • Line 7: warning: don't use underscores in Go names; const LogTarget_UserClient should be LogTargetUserClient (golint)
    • Line 8: warning: don't use underscores in Go names; const LogTarget_Message should be LogTargetMessage (golint)
    • Line 12: warning: don't use underscores in Go names; const LogLevel_Debug should be LogLevelDebug (golint)
    • Line 12: warning: exported const LogLevel_Debug should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: don't use underscores in Go names; const LogLevel_Info should be LogLevelInfo (golint)
    • Line 14: warning: don't use underscores in Go names; const LogLevel_Warn should be LogLevelWarn (golint)
    • Line 15: warning: don't use underscores in Go names; const LogLevel_Error should be LogLevelError (golint)
    • longweb/httpserver/handlers/wshandler.go
    • Line 7: warning: should not use dot imports (golint)
    • Line 9: warning: should not use dot imports (golint)
    • Line 15: warning: exported type GroupIDs should have comment or be unexported (golint)
    • Line 20: warning: comment on exported function OnWebSocket should be of the form "OnWebSocket ..." (golint)
    • longweb/framework/log/innerlogger.go
    • Line 13: warning: exported type InnerLogger should have comment or be unexported (golint)
    • Line 18: warning: exported function GetInnerLogger should have comment or be unexported (golint)
    • Line 25: warning: exported method InnerLogger.Debug should have comment or be unexported (golint)
    • Line 29: warning: exported method InnerLogger.Info should have comment or be unexported (golint)
    • Line 33: warning: exported method InnerLogger.Warn should have comment or be unexported (golint)
    • Line 41: warning: comment on exported function StartInnerLogHandler should be of the form "StartInnerLogHandler ..." (golint)
    • longweb/message/auth.go
    • Line 11: warning: comment on exported function CheckAuthToken should be of the form "CheckAuthToken ..." (golint)
    • Line 56: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 63: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 68: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • longweb/framework/http/httputil.go
    • Line 1: warning: package comment should be of the form "Package httputil ..." (golint)
    • Line 33: warning: exported function HttpGet should have comment or be unexported (golint)
    • Line 61: warning: exported function HttpPost should have comment or be unexported (golint)
    • Line 94: warning: comment on exported function GetQuery should be of the form "GetQuery ..." (golint)
    • Line 102: warning: comment on exported function GetCurrentDirectory should be of the form "GetCurrentDirectory ..." (golint)
    • longweb/framework/slice/slices.go
    • Line 11: warning: exported function Slice_randList should have comment or be unexported (golint)
    • Line 11: warning: don't use underscores in Go names; func Slice_randList should be SliceRandList (golint)
    • Line 19: warning: should omit 2nd value from range; this loop is equivalent to `for index := range ...` (golint)
    • Line 25: warning: exported function Slice_merge should have comment or be unexported (golint)
    • Line 25: warning: don't use underscores in Go names; func Slice_merge should be SliceMerge (golint)
    • Line 30: warning: exported function In_slice should have comment or be unexported (golint)
    • Line 30: warning: don't use underscores in Go names; func In_slice should be InSlice (golint)
    • Line 39: warning: exported function Slice_reduce should have comment or be unexported (golint)
    • Line 39: warning: don't use underscores in Go names; func Slice_reduce should be SliceReduce (golint)
    • Line 46: warning: exported function Slice_rand should have comment or be unexported (golint)
    • Line 46: warning: don't use underscores in Go names; func Slice_rand should be SliceRand (golint)
    • Line 52: warning: exported function Slice_sum should have comment or be unexported (golint)
    • Line 52: warning: don't use underscores in Go names; func Slice_sum should be SliceSum (golint)
    • Line 59: warning: exported function Slice_filter should have comment or be unexported (golint)
    • Line 59: warning: don't use underscores in Go names; func Slice_filter should be SliceFilter (golint)
    • Line 68: warning: exported function Slice_diff should have comment or be unexported (golint)
    • Line 68: warning: don't use underscores in Go names; func Slice_diff should be SliceDiff (golint)
    • Line 77: warning: exported function Slice_intersect should have comment or be unexported (golint)
    • Line 77: warning: don't use underscores in Go names; func Slice_intersect should be SliceIntersect (golint)
    • Line 86: warning: exported function Slice_chunk should have comment or be unexported (golint)
    • Line 86: warning: don't use underscores in Go names; func Slice_chunk should be SliceChunk (golint)
    • Line 99: warning: exported function Slice_range should have comment or be unexported (golint)
    • Line 99: warning: don't use underscores in Go names; func Slice_range should be SliceRange (golint)
    • Line 106: warning: exported function Slice_pad should have comment or be unexported (golint)
    • Line 106: warning: don't use underscores in Go names; func Slice_pad should be SlicePad (golint)
    • Line 116: warning: exported function Slice_unique should have comment or be unexported (golint)
    • Line 116: warning: don't use underscores in Go names; func Slice_unique should be SliceUnique (golint)
    • Line 125: warning: exported function Slice_shuffle should have comment or be unexported (golint)
    • Line 125: warning: don't use underscores in Go names; func Slice_shuffle should be SliceShuffle (golint)
    • longweb/config/appconfig.go
    • Line 15: warning: exported var CurrentConfig should have comment or be unexported (golint)
    • Line 31: warning: exported function SetBaseDir should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function InitConfig should be of the form "InitConfig ..." (golint)
    • Line 84: warning: exported function GetAppList should have comment or be unexported (golint)
    • Line 88: warning: exported function GetAppInfo should have comment or be unexported (golint)
    • Line 95: warning: comment on exported function CheckAllowIP should be of the form "CheckAllowIP ..." (golint)
    • longweb/message/message.go
    • Line 8: warning: should not use dot imports (golint)
    • Line 20: warning: exported const MaxQueueMessageCount should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function ReStartMessageService should be of the form "ReStartMessageService ..." (golint)
    • Line 55: warning: comment on exported function StartMessageService should be of the form "StartMessageService ..." (golint)
    • Line 84: warning: don't use underscores in Go names; func task_DealMessage should be taskDealMessage (golint)
    • Line 194: warning: comment on exported type MessageQueue should be of the form "MessageQueue ..." (with optional leading article) (golint)
    • Line 200: warning: comment on exported type Message should be of the form "Message ..." (with optional leading article) (golint)
    • Line 229: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 234: warning: comment on exported function PushMessage should be of the form "PushMessage ..." (golint)
    • Line 242: warning: don't use underscores in Go names; var err_jsonunmar should be errJsonunmar (golint)
    • Line 251: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 267: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • longweb/message/userclient.go
    • Line 8: warning: should not use dot imports (golint)
    • Line 20: warning: exported const DefaultTimeOut should have comment or be unexported (golint)
    • Line 22: warning: exported function GetMaxClientIndex should have comment or be unexported (golint)
    • Line 26: warning: exported function GetTotalClientCreateCount should have comment or be unexported (golint)
    • Line 30: warning: comment on exported var AppPool should be of the form "AppPool ..." (golint)
    • Line 56: warning: comment on exported type UserClient should be of the form "UserClient ..." (with optional leading article) (golint)
    • Line 76: warning: comment on exported function NewClient should be of the form "NewClient ..." (golint)
    • Line 86: warning: comment on exported function RegisterClient should be of the form "RegisterClient ..." (golint)
    • Line 123: warning: comment on exported function RemoveClient should be of the form "RemoveClient ..." (golint)
    • Line 166: warning: comment on exported method UserClient.Reset should be of the form "Reset ..." (golint)
    • Line 198: warning: comment on exported method UserClient.SendMessage should be of the form "SendMessage ..." (golint)
    • Line 219: warning: comment on exported method UserClient.GetRemoteAddr should be of the form "GetRemoteAddr ..." (golint)
    • Line 229: warning: comment on exported method UserClient.ReadMessage should be of the form "ReadMessage ..." (golint)
    • Line 252: warning: comment on exported method UserClient.GetWebSocket should be of the form "GetWebSocket ..." (golint)
    • Line 257: warning: comment on exported method UserClient.GetReferrerUrl should be of the form "GetReferrerUrl ..." (golint)
    • Line 268: warning: comment on exported method UserClient.GetClientInfo should be of the form "GetClientInfo ..." (golint)
    • Line 278: warning: comment on exported method UserClient.GetIndex should be of the form "GetIndex ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!