microsoft / xbox-live-api
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 3,935 units with 50,897 lines of code in units (46.8% of code).
    • 35 very long units (4,788 lines of code)
    • 137 long units (9,272 lines of code)
    • 435 medium size units (13,643 lines of code)
    • 641 small units (9,285 lines of code)
    • 2,687 very small units (13,909 lines of code)
9% | 18% | 26% | 18% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp12% | 25% | 31% | 17% | 12%
hpp11% | 10% | 21% | 19% | 37%
h0% | 8% | 18% | 18% | 55%
mm0% | 43% | 43% | 0% | 12%
cs0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Source/Services11% | 27% | 31% | 18% | 10%
Source/Shared16% | 18% | 25% | 17% | 22%
Include/cpprestinclude4% | 10% | 24% | 17% | 43%
Include/xsapi-cpp6% | 3% | 8% | 22% | 57%
Source/System0% | 9% | 61% | 13% | 15%
External/Xal0% | 0% | 27% | 17% | 55%
Build/Microsoft.Xbox.Services.141.GDK.C.Thunks0% | 0% | 50% | 50% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
HRESULT MultiplayerLobbyClient::CommitLobbyChanges()
in Source/Services/Multiplayer/Manager/multiplayer_lobby_client.cpp
311 34 3
170 141 2
170 141 2
datetime __cdecl datetime::from_string()
in Include/cpprestinclude/cpprest/details/asyncrt_utils.hpp
168 23 2
datetime datetime::from_string()
in Source/Shared/HookedUri/details/asyncrt_utils.hpp
168 23 2
datetime datetime::from_string()
in Source/Shared/http_utils.cpp
168 23 2
void MultiplayerLobbyClient::AdvertiseGameSession()
in Source/Services/Multiplayer/Manager/multiplayer_lobby_client.cpp
164 20 0
void XblMultiplayerSession::SerializeSessionConstants()
in Source/Services/Multiplayer/multiplayer_session.cpp
160 30 2
Result MultiplayerSessionMember::Deserialize()
in Source/Services/Multiplayer/multiplayer_session_member.cpp
157 29 1
150 133 1
145 133 1
142 136 1
HRESULT MultiplayerService::WriteSessionUsingSubpath()
in Source/Services/Multiplayer/multiplayer_service.cpp
139 18 4
bool inner_parse()
in Source/Shared/http_utils.cpp
139 35 14
bool inner_parse()
in Include/cpprestinclude/cpprest/details/uri_parser.hpp
137 35 14
bool inner_parse()
in Source/Shared/HookedUri/details/uri_parser.hpp
137 35 14
HRESULT XblContext::Initialize()
in Source/Services/Common/xbox_live_context.cpp
134 8 1
HRESULT NotificationService::RegisterForNotificationsHelper()
in Source/Services/Notification/notification_service.cpp
125 13 7
HRESULT XblMultiplayerSession::DeserializeSessionConstants()
in Source/Services/Multiplayer/multiplayer_session.cpp
122 15 1
HRESULT MultiplayerGameClient::JoinGameForAllLocalMembers()
in Source/Services/Multiplayer/Manager/multiplayer_game_client.cpp
121 16 4