aws-samples / fargate-game-servers
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 78 units with 1,362 lines of code in units (21.9% of code).
    • 2 very long units (220 lines of code)
    • 4 long units (268 lines of code)
    • 7 medium size units (231 lines of code)
    • 31 small units (435 lines of code)
    • 34 very small units (208 lines of code)
16% | 19% | 16% | 31% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py68% | 27% | 0% | 4% | 0%
cs0% | 17% | 22% | 40% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
BackendServices/functions68% | 27% | 0% | 4% | 0%
UnityProject/Assets/Scripts/Server0% | 24% | 20% | 46% | 8%
UnityProject/Assets/Scripts/Client0% | 13% | 31% | 31% | 22%
UnityProject/Assets/Scripts/NetworkingShared0% | 0% | 0% | 46% | 53%
UnityProject/Assets/Scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in BackendServices/functions/updateredis.py
111 24 2
def lambda_handler()
in BackendServices/functions/scaler.py
109 19 2
def lambda_handler()
in BackendServices/functions/requestgamesession.py
87 23 2
public void Update()
in UnityProject/Assets/Scripts/Server/Server.cs
73 14 0
void ProcessMessages()
in UnityProject/Assets/Scripts/Client/Client.cs
54 14 0
private void ProcessMessages()
in UnityProject/Assets/Scripts/Server/Server.cs
54 8 0
HttpRequestMessage generateSignedRequest()
in UnityProject/Assets/Scripts/Client/MatchmakingClient.cs
46 6 1
public void UpdateRedis()
in UnityProject/Assets/Scripts/Server/Server.cs
39 4 1
public IEnumerator RequestGameSession()
in UnityProject/Assets/Scripts/Client/NetworkClient.cs
35 4 0
void FixedUpdate()
in UnityProject/Assets/Scripts/Server/Server.cs
35 7 0
private void HandleWaitingForTermination()
in UnityProject/Assets/Scripts/Server/Server.cs
32 3 0
private bool TryConnect()
in UnityProject/Assets/Scripts/Client/NetworkClient.cs
23 3 0
void FixedUpdate()
in UnityProject/Assets/Scripts/Client/SimpleController.cs
21 9 0
IEnumerator GetTaskMetadata()
in UnityProject/Assets/Scripts/Server/Server.cs
20 2 1
public GameSessionInfo RequestGameSession()
in UnityProject/Assets/Scripts/Client/MatchmakingClient.cs
19 3 0
public void TerminateGameSession()
in UnityProject/Assets/Scripts/Server/Server.cs
19 2 0
public void TransmitMessage()
in UnityProject/Assets/Scripts/Server/Server.cs
18 4 2
public void TransmitMessage()
in UnityProject/Assets/Scripts/Server/Server.cs
18 5 2
public void ReceivePosition()
in UnityProject/Assets/Scripts/NetworkingShared/NetworkPlayer.cs
18 2 2
private void HandleMessage()
in UnityProject/Assets/Scripts/Client/NetworkClient.cs
16 7 1