aws-samples / amazon-gamelift-fleetiq-with-amazon-ecs
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,170 lines of code in units (21.3% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (238 lines of code)
    • 10 medium size units (308 lines of code)
    • 30 small units (416 lines of code)
    • 34 very small units (208 lines of code)
0% | 20% | 26% | 35% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 17% | 22% | 40% | 20%
py0% | 43% | 56% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
UnityProject/Assets/Scripts/Server0% | 24% | 21% | 44% | 9%
BackendServices/functions0% | 43% | 56% | 0% | 0%
UnityProject/Assets/Scripts/Client0% | 13% | 31% | 32% | 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
public void Update()
in UnityProject/Assets/Scripts/Server/Server.cs
73 14 0
def lambda_handler()
in BackendServices/functions/requestgamesession.py
57 3 2
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
def get_available_memory_and_cpu()
in BackendServices/functions/scaler.py
39 11 1
public IEnumerator RequestGameSession()
in UnityProject/Assets/Scripts/Client/NetworkClient.cs
35 4 0
def lambda_handler()
in BackendServices/functions/scaler.py
34 13 2
void FixedUpdate()
in UnityProject/Assets/Scripts/Server/Server.cs
32 7 0
private void Update()
in UnityProject/Assets/Scripts/Server/Server.cs
29 7 0
IEnumerator GetTaskMetadata()
in UnityProject/Assets/Scripts/Server/Server.cs
26 2 1
private bool TryConnect()
in UnityProject/Assets/Scripts/Client/NetworkClient.cs
25 3 0
void FixedUpdate()
in UnityProject/Assets/Scripts/Client/SimpleController.cs
21 9 0
public void UpdateFleetIQ()
in UnityProject/Assets/Scripts/Server/Server.cs
21 3 1
public GameSessionInfo RequestGameSession()
in UnityProject/Assets/Scripts/Client/MatchmakingClient.cs
19 3 0
IEnumerator ConnectToServer()
in UnityProject/Assets/Scripts/Client/Client.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