aws-samples / aws-gamelift-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 470 units with 3,322 lines of code in units (25.0% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (290 lines of code)
    • 41 medium size units (1,330 lines of code)
    • 46 small units (682 lines of code)
    • 379 very small units (1,020 lines of code)
0% | 8% | 40% | 20% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 10% | 48% | 21% | 19%
c0% | 84% | 0% | 11% | 4%
h0% | 0% | 27% | 14% | 58%
py0% | 0% | 47% | 31% | 20%
js0% | 0% | 0% | 100% | 0%
hpp0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
GomokuServer/GomokuServer0% | 6% | 36% | 22% | 34%
Shared0% | 24% | 39% | 10% | 26%
GomokuClient/GomokuClient0% | 12% | 53% | 11% | 22%
Lambda0% | 0% | 60% | 30% | 9%
web0% | 0% | 0% | 100% | 0%
FleetIQ0% | 0% | 0% | 36% | 63%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int ini_parse_stream()
in Shared/ini.c
83 25 4
string parse_string()
in GomokuServer/GomokuServer/json11.cpp
76 23 0
Json parse_json()
in GomokuServer/GomokuServer/json11.cpp
67 25 1
void GUIController::OnRenderBoard()
in GomokuClient/GomokuClient/GUIController.cpp
64 9 0
static std::string GetDefaultNameForErrorType()
in GomokuServer/GomokuServer/include/aws/gamelift/common/GameLiftErrors.h
50 23 1
static std::string GetDefaultMessageForErrorType()
in GomokuServer/GomokuServer/include/aws/gamelift/common/GameLiftErrors.h
50 23 1
void IOThread::DoIocpJob()
in GomokuServer/GomokuServer/IOThread.cpp
49 13 0
bool CircularBuffer::Read()
in Shared/CircularBuffer.cpp
46 9 2
int main()
in GomokuServer/GomokuServer/GomokuServer.cpp
45 7 2
inline AWS_GAMELIFT_API UpdateReason GetUpdateReasonForName()
in GomokuServer/GomokuServer/include/aws/gamelift/server/model/UpdateReason.h
44 9 1
void GameSession::PutStone()
in GomokuServer/GomokuServer/GameSession.cpp
42 13 3
Json parse_number()
in GomokuServer/GomokuServer/json11.cpp
40 19 0
static pbuffer::AttributeValue ParseFromAttributeValue()
in GomokuServer/GomokuServer/include/aws/gamelift/internal/modelmapper/AttributeValueMapper.h
40 6 1
inline AWS_GAMELIFT_API GameSessionStatus GetGameSessionStatusForName()
in GomokuServer/GomokuServer/include/aws/gamelift/server/model/GameSessionStatus.h
39 9 1
void NetController::ProcessPacket()
in GomokuClient/GomokuClient/NetController.cpp
39 7 0
void CircularBuffer::Remove()
in Shared/CircularBuffer.cpp
37 9 1
void MatchController::RequestMatch()
in GomokuClient/GomokuClient/MatchController.cpp
37 6 0
static void dump()
in GomokuServer/GomokuServer/json11.cpp
36 16 2
void MakeDump()
in GomokuServer/GomokuServer/Exception.cpp
36 4 1
static pbuffer::AttributeValue ParseFromAttributeValue()
in GomokuServer/GomokuServer/include/aws/gamelift/internal/modelmapper/AttributeValueMapper.h
36 6 1