Preparing report...

Report for github.com/xiaonanln/goworld

A+    Excellent!    Found 65 issues across 139 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!


gocyclo92%

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.


golint56%

Golint is a linter for Go source code.

    • goworld/engine/config/read_config.go
    • Line 116: warning: exported type DebugConfig should have comment or be unexported (golint)
    • Line 170: warning: exported function GetDeployment should have comment or be unexported (golint)
    • Line 232: warning: exported function Debug should have comment or be unexported (golint)
    • goworld/engine/kvreg/kvreg.go
    • Line 11: warning: exported type RegisterCallback should have comment or be unexported (golint)
    • Line 18: warning: exported function Register should have comment or be unexported (golint)
    • Line 23: warning: exported function TraverseByPrefix should have comment or be unexported (golint)
    • Line 31: warning: exported function WatchKvregRegister should have comment or be unexported (golint)
    • Line 40: warning: exported function ClearByDispatcher should have comment or be unexported (golint)
    • Line 56: warning: exported function AddPostCallback should have comment or be unexported (golint)
    • goworld/engine/netutil/Packet.go
    • Line 181: warning: exported method Packet.AppendMapStringString should have comment or be unexported (golint)
    • Line 189: warning: exported method Packet.ReadMapStringString should have comment or be unexported (golint)
    • Line 259: warning: exported method Packet.AppendEntityIDSet should have comment or be unexported (golint)
    • Line 266: warning: exported method Packet.ReadEntityIDSet should have comment or be unexported (golint)
    • Line 285: warning: exported method Packet.Retain should have comment or be unexported (golint)
    • goworld/ext/db/gwredis/gwredis.go
    • Line 12: warning: exported type DB should have comment or be unexported (golint)
    • Line 16: warning: exported function Dial should have comment or be unexported (golint)
    • Line 21: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 27: warning: exported function DialURL should have comment or be unexported (golint)
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 38: warning: exported method DB.Do should have comment or be unexported (golint)
    • goworld/engine/gwlog/gwlog.go
    • Line 67: warning: don't use underscores in Go names; func parameter source_ should be source (golint)
    • Line 130: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 134: warning: exported function Infof should have comment or be unexported (golint)
    • Line 138: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 142: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 146: warning: exported function Panicf should have comment or be unexported (golint)
    • Line 150: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 155: warning: exported function Error should have comment or be unexported (golint)
    • Line 159: warning: exported function Panic should have comment or be unexported (golint)
    • Line 163: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 167: warning: don't use underscores in Go names; func parameter sugar_ should be sugar (golint)
    • goworld/examples/chatroom_demo/Account.go
    • Line 16: warning: exported method Account.DescribeEntityType should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; method Register_Client should be RegisterClient (golint)
    • Line 44: warning: don't use underscores in Go names; method Login_Client should be LoginClient (golint)
    • goworld/engine/proto/proto.go
    • Line 46: warning: comment on exported const MT_MIGRATE_REQUEST should be of the form "MT_MIGRATE_REQUEST ..." (golint)
    • Line 53: warning: exported const MT_CANCEL_MIGRATE should have comment (or a comment on this block) or be unexported (golint)
    • Line 125: warning: comment on exported type FilterClientsOpType should be of the form "FilterClientsOpType ..." (with optional leading article) (golint)
    • Line 129: warning: exported const FILTER_CLIENTS_OP_EQ should have comment (or a comment on this block) or be unexported (golint)
    • goworld/examples/test_game/Avatar.go
    • Line 24: warning: exported method Avatar.DescribeEntityType should have comment or be unexported (golint)
    • Line 39: warning: exported method Avatar.OnInit should have comment or be unexported (golint)
    • Line 43: warning: exported method Avatar.OnAttrsReady should have comment or be unexported (golint)
    • Line 75: warning: don't use underscores in Go names; method TestListField_Client should be TestListFieldClient (golint)
    • Line 114: warning: don't use underscores in Go names; method EnterSpace_Client should be EnterSpaceClient (golint)
    • Line 145: warning: exported method Avatar.EnterRandomNilSpace_Client should have comment or be unexported (golint)
    • Line 145: warning: don't use underscores in Go names; method EnterRandomNilSpace_Client should be EnterRandomNilSpaceClient (golint)
    • Line 163: warning: comment on exported method Avatar.OnMigrateIn should be of the form "OnMigrateIn ..." (golint)
    • Line 180: warning: don't use underscores in Go names; method SendMail_Client should be SendMailClient (golint)
    • Line 195: warning: don't use underscores in Go names; method GetMails_Client should be GetMailsClient (golint)
    • Line 228: warning: don't use underscores in Go names; method Say_Client should be SayClient (golint)
    • Line 241: warning: don't use underscores in Go names; method Move_Client should be MoveClient (golint)
    • Line 249: warning: don't use underscores in Go names; method TestPublish_Client should be TestPublishClient (golint)
    • Line 257: warning: exported method Avatar.OnPublish should have comment or be unexported (golint)
    • Line 264: warning: exported method Avatar.TestAOI_Client should have comment or be unexported (golint)
    • Line 264: warning: don't use underscores in Go names; method TestAOI_Client should be TestAOIClient (golint)
    • Line 278: warning: exported method Avatar.TestCallAll_Client should have comment or be unexported (golint)
    • Line 278: warning: don't use underscores in Go names; method TestCallAll_Client should be TestCallAllClient (golint)
    • Line 290: warning: exported method Avatar.TestCallAllEcho_AllClients should have comment or be unexported (golint)
    • Line 290: warning: don't use underscores in Go names; method TestCallAllEcho_AllClients should be TestCallAllEchoAllClients (golint)
    • Line 306: warning: exported method Avatar.TestComplexAttr_Client should have comment or be unexported (golint)
    • Line 306: warning: don't use underscores in Go names; method TestComplexAttr_Client should be TestComplexAttrClient (golint)
    • goworld/engine/dispatchercluster/dispatchercluster.go
    • Line 18: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 39: warning: exported function SendNotifyDestroyEntity should have comment or be unexported (golint)
    • Line 43: warning: exported function SendMigrateRequest should have comment or be unexported (golint)
    • Line 47: warning: exported function SendRealMigrate should have comment or be unexported (golint)
    • Line 50: warning: exported function SendCallFilterClientProxies should have comment or be unexported (golint)
    • Line 63: warning: exported function SendNotifyCreateEntity should have comment or be unexported (golint)
    • Line 71: warning: exported function SendLoadEntityAnywhere should have comment or be unexported (golint)
    • Line 75: warning: exported function SendLoadEntityOnGame should have comment or be unexported (golint)
    • Line 79: warning: exported function SendCreateEntitySomewhere should have comment or be unexported (golint)
    • Line 83: warning: exported function SendGameLBCInfo should have comment or be unexported (golint)
    • Line 89: warning: exported function SendStartFreezeGame should have comment or be unexported (golint)
    • Line 96: warning: exported function SendKvregRegister should have comment or be unexported (golint)
    • Line 100: warning: exported function SendCallNilSpaces should have comment or be unexported (golint)
    • Line 107: warning: exported function EntityIDToDispatcherID should have comment or be unexported (golint)
    • Line 111: warning: exported function SrvIDToDispatcherID should have comment or be unexported (golint)
    • Line 115: warning: exported function SelectByEntityID should have comment or be unexported (golint)
    • Line 120: warning: exported function SelectByGateID should have comment or be unexported (golint)
    • Line 125: warning: exported function SelectByDispatcherID should have comment or be unexported (golint)
    • Line 129: warning: exported function SelectBySrvID should have comment or be unexported (golint)
    • Line 134: warning: exported function Select should have comment or be unexported (golint)
    • goworld/engine/entity/space_ops.go
    • Line 41: warning: comment on exported function GetNilSpaceID should be of the form "GetNilSpaceID ..." (golint)
    • Line 48: warning: exported function GetNilSpace should have comment or be unexported (golint)
    • goworld/examples/test_client/ClientEntity.go
    • Line 543: warning: don't use underscores in Go names; method OnAttrChange_exp should be OnAttrChangeExp (golint)
    • Line 549: warning: don't use underscores in Go names; method OnAttrChange_testpop should be OnAttrChangeTestpop (golint)
    • Line 561: warning: don't use underscores in Go names; method OnAttrChange_subattr should be OnAttrChangeSubattr (golint)
    • goworld/cn/goworld_cn.go
    • Line 1: warning: package comment should be of the form "Package goworld ..." (golint)
    • Line 118: warning: comment on exported function CreateSpaceOnGame should be of the form "CreateSpaceOnGame ..." (golint)
    • Line 301: warning: exported function Post should have comment or be unexported (golint)
    • goworld/engine/netutil/Connection.go
    • Line 8: warning: exported type Connection should have comment or be unexported (golint)
    • Line 12: warning: exported type NetConn should have comment or be unexported (golint)
    • Line 16: warning: exported method NetConn.Flush should have comment or be unexported (golint)
    • goworld/engine/binutil/unix.go
    • Line 12: warning: exported function Daemonize should have comment or be unexported (golint)
    • Line 25: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • goworld/goworld.go
    • Line 17: warning: comment on exported type Vector3 should be of the form "Vector3 ..." (with optional leading article) (golint)
    • Line 78: warning: comment on exported function CreateEntityAnywhere should be of the form "CreateEntityAnywhere ..." (golint)
    • Line 83: warning: exported function CreateEntityOnGame should have comment or be unexported (golint)
    • Line 220: warning: comment on exported function GetOrPutKVDB should be of the form "GetOrPutKVDB ..." (golint)
    • Line 230: warning: comment on exported function AddCallback should be of the form "AddCallback ..." (golint)
    • goworld/engine/entity/MapAttr.go
    • Line 239: 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 248: 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 257: 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 266: 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 275: 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 286: 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 322: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 332: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 342: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 352: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 362: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 372: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • goworld/engine/gwvar/gwvar.go
    • Line 5: warning: exported type Bool should have comment or be unexported (golint)
    • Line 9: warning: exported function NewBool should have comment or be unexported (golint)
    • Line 15: warning: exported method Bool.Value should have comment or be unexported (golint)
    • Line 19: warning: exported method Bool.Set should have comment or be unexported (golint)
    • Line 28: warning: exported var IsDeploymentReady should have comment or be unexported (golint)
    • goworld/engine/entity/Vector3.go
    • Line 35: warning: exported method Vector3.Add should have comment or be unexported (golint)
    • Line 45: warning: receiver name dir should be consistent with previous receiver name p for Vector3 (golint)
    • Line 64: warning: exported method Vector3.Normalize should have comment or be unexported (golint)
    • Line 74: warning: exported method Vector3.Normalized should have comment or be unexported (golint)
    • goworld/doc.go
    • Line 1: warning: package comment should be of the form "Package goworld ..." (golint)
    • goworld/engine/service/service.go
    • Line 65: warning: exported function RegisterService should have comment or be unexported (golint)
    • Line 78: warning: exported function Setup should have comment or be unexported (golint)
    • Line 78: warning: don't use underscores in Go names; func parameter gameid_ should be gameid (golint)
    • Line 83: warning: exported function OnDeploymentReady should have comment or be unexported (golint)
    • Line 258: warning: exported function CallServiceAny should have comment or be unexported (golint)
    • Line 274: warning: exported function CallServiceAll should have comment or be unexported (golint)
    • Line 292: warning: exported function CallServiceShardIndex should have comment or be unexported (golint)
    • Line 308: warning: exported function CallServiceShardKey should have comment or be unexported (golint)
    • Line 330: warning: exported function GetServiceEntityID should have comment or be unexported (golint)
    • Line 334: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 339: warning: exported function GetServiceShardCount should have comment or be unexported (golint)
    • Line 343: warning: exported function CheckServiceEntitiesReady should have comment or be unexported (golint)
    • goworld/components/game/GameService.go
    • Line 40: warning: exported type GameService should have comment or be unexported (golint)
    • Line 275: warning: exported method GameService.HandleCreateEntitySomewhere should have comment or be unexported (golint)
    • Line 282: warning: exported method GameService.HandleLoadEntitySomewhere should have comment or be unexported (golint)
    • Line 289: warning: exported method GameService.HandleKvregRegister should have comment or be unexported (golint)
    • Line 299: warning: exported method GameService.HandleGateDisconnected should have comment or be unexported (golint)
    • Line 303: warning: exported method GameService.HandleStartFreezeGameAck should have comment or be unexported (golint)
    • Line 395: warning: exported method GameService.HandleSyncPositionYawFromClient should have comment or be unexported (golint)
    • Line 409: warning: exported method GameService.HandleCallEntityMethod should have comment or be unexported (golint)
    • Line 416: warning: exported method GameService.HandleNotifyClientConnected should have comment or be unexported (golint)
    • Line 427: warning: exported method GameService.HandleCallNilSpaces should have comment or be unexported (golint)
    • Line 436: warning: exported method GameService.HandleNotifyClientDisconnected should have comment or be unexported (golint)
    • Line 444: warning: exported method GameService.HandleQuerySpaceGameIDForMigrateAck should have comment or be unexported (golint)
    • Line 451: warning: exported method GameService.HandleMigrateRequestAck should have comment or be unexported (golint)
    • Line 463: warning: exported method GameService.HandleRealMigrate should have comment or be unexported (golint)
    • goworld/engine/entity/Space.go
    • Line 43: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 48: warning: exported method Space.DescribeEntityType should have comment or be unexported (golint)
    • Line 52: warning: exported method Space.GetSpaceRange should have comment or be unexported (golint)
    • Line 56: warning: exported method Space.GetTowerRange should have comment or be unexported (golint)
    • Line 91: warning: exported method Space.EnableAOI should have comment or be unexported (golint)
    • Line 304: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • goworld/examples/unity_demo/Player.go
    • Line 17: warning: exported method Player.DescribeEntityType should have comment or be unexported (golint)
    • Line 50: warning: receiver name p should be consistent with previous receiver name a for Player (golint)
    • Line 73: warning: don't use underscores in Go names; method EnterSpace_Client should be EnterSpaceClient (golint)
    • Line 98: warning: exported method Player.SetAction_Client should have comment or be unexported (golint)
    • Line 98: warning: don't use underscores in Go names; method SetAction_Client should be SetActionClient (golint)
    • Line 106: warning: exported method Player.ShootMiss_Client should have comment or be unexported (golint)
    • Line 106: warning: don't use underscores in Go names; method ShootMiss_Client should be ShootMissClient (golint)
    • Line 110: warning: exported method Player.ShootHit_Client should have comment or be unexported (golint)
    • Line 110: warning: don't use underscores in Go names; method ShootHit_Client should be ShootHitClient (golint)
    • Line 126: warning: exported method Player.TakeDamage should have comment or be unexported (golint)
    • Line 126: warning: receiver name player should be consistent with previous receiver name a for Player (golint)
    • goworld/ext/db/gwmongo/gwmongo.go
    • Line 19: warning: comment on exported type DB should be of the form "DB ..." (with optional leading article) (golint)
    • Line 269: warning: comment on exported method DB.RemoveAll should be of the form "RemoveAll ..." (golint)
    • goworld/engine/entity/ListAttr.go
    • Line 238: warning: exported method ListAttr.PopInt should have comment or be unexported (golint)
    • Line 242: warning: exported method ListAttr.PopFloat should have comment or be unexported (golint)
    • Line 246: warning: exported method ListAttr.PopBool should have comment or be unexported (golint)
    • Line 250: warning: exported method ListAttr.PopStr should have comment or be unexported (golint)
    • goworld/engine/proto/GoWorldConnection.go
    • Line 107: warning: comment on exported method GoWorldConnection.SendKvregRegister should be of the form "SendKvregRegister ..." (golint)
    • Line 167: warning: exported method GoWorldConnection.SetHeartbeatFromClient should have comment or be unexported (golint)
    • Line 288: warning: comment on exported function AllocCallFilterClientProxiesPacket should be of the form "AllocCallFilterClientProxiesPacket ..." (golint)
    • Line 300: warning: exported function AllocCallNilSpacesPacket should have comment or be unexported (golint)
    • Line 310: warning: exported function AllocGameLBCInfoPacket should have comment or be unexported (golint)
    • Line 354: warning: exported function AllocStartFreezeGamePacket should have comment or be unexported (golint)
    • Line 360: warning: exported function MakeNotifyGameConnectedPacket should have comment or be unexported (golint)
    • Line 367: warning: exported function MakeNotifyGameDisconnectedPacket should have comment or be unexported (golint)
    • Line 374: warning: exported function MakeNotifyDeploymentReadyPacket should have comment or be unexported (golint)
    • Line 380: warning: exported method GoWorldConnection.SendSetGameIDAck should have comment or be unexported (golint)
    • Line 437: warning: exported method GoWorldConnection.RecvChan should have comment or be unexported (golint)
    • goworld/examples/unity_demo/Monster.go
    • Line 21: warning: exported method Monster.DescribeEntityType should have comment or be unexported (golint)
    • Line 30: warning: exported method Monster.OnEnterSpace should have comment or be unexported (golint)
    • Line 48: warning: exported method Monster.AI should have comment or be unexported (golint)
    • Line 78: warning: exported method Monster.Tick should have comment or be unexported (golint)
    • Line 102: warning: exported method Monster.GetSpeed should have comment or be unexported (golint)
    • Line 106: warning: exported method Monster.GetAttackRange should have comment or be unexported (golint)
    • Line 110: warning: exported method Monster.Idling should have comment or be unexported (golint)
    • Line 120: warning: exported method Monster.MovingTo should have comment or be unexported (golint)
    • Line 131: warning: exported method Monster.Attacking should have comment or be unexported (golint)
    • Line 151: warning: exported method Monster.GetDamage should have comment or be unexported (golint)
    • Line 155: warning: exported method Monster.TakeDamage should have comment or be unexported (golint)
    • goworld/engine/entity/EntityManager.go
    • Line 46: warning: exported method EntityTypeDesc.SetPersistent should have comment or be unexported (golint)
    • Line 55: warning: exported method EntityTypeDesc.SetUseAOI should have comment or be unexported (golint)
    • Line 65: warning: exported method EntityTypeDesc.DefineAttr should have comment or be unexported (golint)
    • Line 195: warning: exported function GetEntityTypeDesc should have comment or be unexported (golint)
    • Line 354: warning: comment on exported function CreateEntityLocallyWithID should be of the form "CreateEntityLocallyWithID ..." (golint)
    • Line 381: warning: exported function LoadEntityOnGame should have comment or be unexported (golint)
    • Line 399: warning: exported function Call should have comment or be unexported (golint)
    • Line 414: warning: exported function CallNilSpaces should have comment or be unexported (golint)
    • Line 423: warning: exported function OnCallNilSpaces should have comment or be unexported (golint)
    • Line 466: warning: exported function GetEntitiesByType should have comment or be unexported (golint)
    • goworld/examples/unity_demo/Account.go
    • Line 16: warning: exported method Account.DescribeEntityType should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; method Register_Client should be RegisterClient (golint)
    • Line 44: warning: don't use underscores in Go names; method Login_Client should be LoginClient (golint)
    • goworld/engine/entity/Entity.go
    • Line 227: warning: exported method Entity.OnEnterAOI should have comment or be unexported (golint)
    • Line 231: warning: exported method Entity.OnLeaveAOI should have comment or be unexported (golint)
    • Line 1221: warning: exported function CollectEntitySyncInfos should have comment or be unexported (golint)
    • Line 1299: warning: exported method Entity.FaceToPos should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words