aws-samples / aws-gamelift-sample
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 470 units with 3,322 lines of code in units (25.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 11 medium complex units (545 lines of code)
    • 19 simple units (625 lines of code)
    • 440 very simple units (2,152 lines of code)
0% | 0% | 16% | 18% | 64%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cpp0% | 0% | 17% | 22% | 59%
h0% | 0% | 10% | 16% | 72%
c0% | 0% | 84% | 0% | 15%
py0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
hpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
GomokuServer/GomokuServer0% | 0% | 20% | 13% | 66%
Shared0% | 0% | 24% | 42% | 33%
GomokuClient/GomokuClient0% | 0% | 0% | 35% | 64%
Lambda0% | 0% | 0% | 0% | 100%
FleetIQ0% | 0% | 0% | 0% | 100%
web0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Json parse_json()
in GomokuServer/GomokuServer/json11.cpp
67 25 1
int ini_parse_stream()
in Shared/ini.c
83 25 4
string parse_string()
in GomokuServer/GomokuServer/json11.cpp
76 23 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
Json parse_number()
in GomokuServer/GomokuServer/json11.cpp
40 19 0
static void dump()
in GomokuServer/GomokuServer/json11.cpp
36 16 2
void IOThread::DoIocpJob()
in GomokuServer/GomokuServer/IOThread.cpp
49 13 0
void GameSession::PutStone()
in GomokuServer/GomokuServer/GameSession.cpp
42 13 3
bool GameSession::IsWin()
in GomokuServer/GomokuServer/GameSession.cpp
19 12 1
bool consume_comment()
in GomokuServer/GomokuServer/json11.cpp
33 11 0
inline AWS_GAMELIFT_API GameSessionStatus GetGameSessionStatusForName()
in GomokuServer/GomokuServer/include/aws/gamelift/server/model/GameSessionStatus.h
39 9 1
inline AWS_GAMELIFT_API UpdateReason GetUpdateReasonForName()
in GomokuServer/GomokuServer/include/aws/gamelift/server/model/UpdateReason.h
44 9 1
bool INIReader::GetBoolean()
in Shared/INIReader.cpp
11 9 3
bool CircularBuffer::Read()
in Shared/CircularBuffer.cpp
46 9 2
void CircularBuffer::Remove()
in Shared/CircularBuffer.cpp
37 9 1
void GUIController::OnMouseEvent()
in GomokuClient/GomokuClient/GUIController.cpp
21 9 4
void GUIController::OnRenderBoard()
in GomokuClient/GomokuClient/GUIController.cpp
64 9 0
LONG WINAPI ExceptionFilter()
in GomokuServer/GomokuServer/Exception.cpp
35 8 1
int main()
in GomokuServer/GomokuServer/GomokuServer.cpp
45 7 2