aws-samples / aws-gamelift-and-serverless-backend-sample
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 97 units with 1,410 lines of code in units (23.4% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (252 lines of code)
    • 12 medium size units (394 lines of code)
    • 37 small units (509 lines of code)
    • 44 very small units (255 lines of code)
0% | 17% | 27% | 36% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 16% | 21% | 42% | 20%
cpp0% | 24% | 55% | 10% | 8%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
GameLiftExampleUnityProject/Assets/Scripts/Server0% | 25% | 8% | 49% | 16%
CppServerAndClient/Client0% | 58% | 26% | 14% | 0%
GameLiftExampleUnityProject/Assets/Scripts/Client0% | 11% | 41% | 33% | 14%
CppServerAndClient/Server0% | 0% | 76% | 7% | 16%
GameLiftExampleUnityProject/Assets/Scripts/NetworkingShared0% | 0% | 0% | 46% | 53%
GameLiftExampleUnityProject/Assets/Scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void Update()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
77 15 0
int main()
in CppServerAndClient/Client/Client.cpp
67 4 0
void ProcessMessages()
in GameLiftExampleUnityProject/Assets/Scripts/Client/Client.cs
54 14 0
private void ProcessMessages()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
54 8 0
public IEnumerator DoMatchMakingAndConnect()
in GameLiftExampleUnityProject/Assets/Scripts/Client/NetworkClient.cs
49 5 1
HttpRequestMessage generateSignedRequest()
in GameLiftExampleUnityProject/Assets/Scripts/Client/MatchmakingClient.cs
46 6 1
public void Awake()
in GameLiftExampleUnityProject/Assets/Scripts/Server/GameLift.cs
44 3 0
int SetupTcpServerAndAcceptTwoPlayer()
in CppServerAndClient/Server/Server.cpp
34 5 2
bool Server::InitializeGameLift()
in CppServerAndClient/Server/Server.cpp
34 4 2
async Task SendHTTPSPingRequest()
in GameLiftExampleUnityProject/Assets/Scripts/Client/Client.cs
33 2 1
int ConnectToServer()
in CppServerAndClient/Client/Client.cpp
30 4 3
public MatchMakingRequestInfo RequestMatchMaking()
in GameLiftExampleUnityProject/Assets/Scripts/Client/MatchmakingClient.cs
26 4 1
void AcceptNewPlayerConnection()
in CppServerAndClient/Server/Server.cpp
26 3 4
int main()
in CppServerAndClient/Server/Server.cpp
26 3 2
private bool TryConnect()
in GameLiftExampleUnityProject/Assets/Scripts/Client/NetworkClient.cs
25 3 0
void FixedUpdate()
in GameLiftExampleUnityProject/Assets/Scripts/Client/SimpleController.cs
21 9 0
private bool HandleMessage()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
19 6 3
void FixedUpdate()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
18 3 0
public void TransmitMessage()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
18 4 2
public void TransmitMessage()
in GameLiftExampleUnityProject/Assets/Scripts/Server/Server.cs
18 5 2