microsoft / xbox-live-samples
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 6,014 units with 89,515 lines of code in units (52.2% of code).
    • 74 very long units (14,419 lines of code)
    • 227 long units (15,903 lines of code)
    • 885 medium size units (26,772 lines of code)
    • 1,057 small units (15,578 lines of code)
    • 3,771 very small units (16,843 lines of code)
16% | 17% | 29% | 17% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp19% | 19% | 31% | 15% | 13%
js8% | 4% | 28% | 23% | 34%
h6% | 29% | 16% | 16% | 31%
cs0% | 10% | 27% | 32% | 30%
java0% | 19% | 27% | 9% | 44%
mm0% | 0% | 0% | 39% | 60%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Kits/ATGTK33% | 22% | 23% | 7% | 12%
CreatorsSDK/Social12% | 10% | 27% | 21% | 29%
ID@XboxSDK/Clubs23% | 26% | 23% | 16% | 10%
ID@XboxSDK/GameSave12% | 20% | 38% | 14% | 14%
ID@XboxSDK/Social20% | 25% | 25% | 15% | 13%
ID@XboxSDK/InGameChat19% | 18% | 33% | 13% | 14%
ID@XboxSDK/Matchmaking23% | 16% | 26% | 17% | 16%
ID@XboxSDK/Multiplayer21% | 18% | 24% | 19% | 15%
ID@XboxSDK/GameSaveCppWinRT12% | 17% | 35% | 16% | 18%
ID@XboxSDK/PositionalChat18% | 20% | 35% | 13% | 12%
ID@XboxSDK/DataPlatform201311% | 9% | 35% | 23% | 20%
Kits/Microsoft.Xbox.Samples.NetworkMesh12% | 10% | 40% | 15% | 20%
ID@XboxSDK/TitleStorage11% | 16% | 32% | 13% | 24%
CreatorsSDK/Leaderboards16% | 8% | 32% | 24% | 17%
MobileSDK/Samples-Cocos2d-x8% | 13% | 28% | 19% | 28%
Kits/LiveTK0% | 23% | 29% | 29% | 17%
ID@XboxSDK/DownloadableContent0% | 36% | 17% | 25% | 21%
ID@XboxSDK/GameTrials0% | 40% | 20% | 13% | 24%
MobileSDK/Samples-Native0% | 11% | 26% | 28% | 33%
ID@XboxSDK/XWebSecFiddlerExtension0% | 28% | 25% | 16% | 29%
ID@XboxSDK/Leaderboards0% | 20% | 36% | 22% | 19%
ID@XboxSDK/Achievements0% | 23% | 28% | 23% | 23%
ID@XboxSDK/DataPlatform20170% | 22% | 19% | 34% | 23%
MobileSDK/Integration0% | 9% | 59% | 25% | 5%
ID@XboxSDK/TCUI0% | 0% | 70% | 20% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void LoadLayout()
in Kits/ATGTK/SampleGUI.cpp
779 159 3
void LoadLayout()
in CreatorsSDK/Social/UWP/Cpp/SampleGUI.cpp
651 130 3
void LoadLayout()
in ID@XboxSDK/Clubs/UWP/Cpp/SampleGUI.cpp
651 130 3
void LoadLayout()
in ID@XboxSDK/Clubs/Xbox/Cpp/SampleGUI.cpp
651 130 3
void LoadLayout()
in ID@XboxSDK/Social/UWP/Cpp/SampleGUI.cpp
651 130 3
(function ()()
in CreatorsSDK/Social/UWP/JS/Social/lib/WinJS-4.0.1/js/en-US/ui.strings.js
507 5 1
HRESULT WaveBankReader::Impl::Open()
in Kits/ATGTK/WaveBankReader.cpp
345 70 1
class __declspec()
in Kits/ATGTK/OrbitCamera.cpp
338 86 1
class __declspec()
in Kits/ATGTK/FlyCamera.cpp
272 63 1
void Sample::RenderMultiplayerEventQueue()
in ID@XboxSDK/Matchmaking/UWP/Cpp/GameLogic/Renderer.cpp
269 42 0
void Sample::RenderMultiplayerEventQueue()
in ID@XboxSDK/Matchmaking/Xbox/Cpp/GameLogic/Renderer.cpp
267 42 0
void GameBoardScreen::Draw()
in ID@XboxSDK/GameSave/UWP/GameLogic/GameBoardScreen.cpp
264 37 2
void GameBoardScreen::Draw()
in ID@XboxSDK/GameSave/Xbox/GameLogic/GameBoardScreen.cpp
264 37 2
void Sample::RenderMultiplayerEventQueue()
in ID@XboxSDK/Multiplayer/UWP/Cpp/GameLogic/Renderer.cpp
259 41 0
void Sample::RenderMultiplayerEventQueue()
in ID@XboxSDK/Multiplayer/Xbox/Cpp/GameLogic/Renderer.cpp
259 41 0
void GameBoardScreen::HandleInput()
in ID@XboxSDK/GameSave/UWP/GameLogic/GameBoardScreen.cpp
255 62 1
void GameBoardScreen::HandleInput()
in ID@XboxSDK/GameSave/Xbox/GameLogic/GameBoardScreen.cpp
255 62 1
void GameBoardScreen::HandleInput()
in ID@XboxSDK/GameSaveCppWinRT/Xbox/GameLogic/GameBoardScreen.cpp
255 62 1
void GameBoardScreen::Draw()
in ID@XboxSDK/GameSaveCppWinRT/Xbox/GameLogic/GameBoardScreen.cpp
237 36 2
void Sample::Update()
in ID@XboxSDK/PositionalChat/Xbox/PositionalChat.cpp
194 44 1