android / games-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 1,171 units with 13,289 lines of code in units (21.2% of code).
    • 1 very long units (112 lines of code)
    • 29 long units (1,827 lines of code)
    • 169 medium size units (4,969 lines of code)
    • 200 small units (2,903 lines of code)
    • 772 very small units (3,478 lines of code)
<1% | 13% | 37% | 21% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h23% | 0% | 27% | 9% | 39%
cpp0% | 17% | 42% | 20% | 18%
java0% | 4% | 37% | 31% | 26%
c0% | 18% | 16% | 31% | 33%
cs0% | 0% | 20% | 29% | 49%
hpp0% | 0% | 0% | 10% | 89%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
agdk/game_controller/common8% | 24% | 35% | 12% | 19%
agdk/agdktunnel/app0% | 15% | 35% | 22% | 26%
agdk/agde/Teapot0% | 14% | 41% | 25% | 19%
agdk/agde/endless-tunnel0% | 12% | 39% | 19% | 28%
agdk/game_controller/gameactivity0% | 17% | 54% | 14% | 14%
agdk/game_controller/nativeactivity0% | 20% | 47% | 15% | 15%
agdk/util/tuningfork0% | 7% | 40% | 24% | 27%
trivialkart/trivialkart-unity/Assets0% | 0% | 20% | 29% | 49%
agdk/common/src0% | 0% | 39% | 42% | 18%
agdk/common/include0% | 0% | 55% | 0% | 45%
agdk/agde/HelloJNI0% | 0% | 0% | 0% | 100%
agdk/agde/AssemblyCode-Link-Objects0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static jclass loadClass()
in agdk/game_controller/common/JNIUtil.h
112 16 5
void NativeEngine::HandleCommand()
in agdk/agdktunnel/app/src/main/cpp/native_engine.cpp
96 24 1
void DemoScene::RenderPanel_ControlsTab()
in agdk/game_controller/common/demo_scene.cpp
84 18 3
void NativeEngine::HandleCommand()
in agdk/game_controller/gameactivity/app/src/main/cpp/native_engine.cpp
82 21 1
void PlayScene::DoFrame()
in agdk/agde/endless-tunnel/endless-tunnel/Android/app/src/main/cpp/play_scene.cpp
78 22 0
void NativeEngine::HandleCommand()
in agdk/game_controller/nativeactivity/app/src/main/cpp/native_engine.cpp
78 20 1
void PlayScene::DoFrame()
in agdk/agdktunnel/app/src/main/cpp/play_scene.cpp
78 22 0
void DemoScene::RenderPanel_InfoTab()
in agdk/game_controller/common/demo_scene.cpp
68 12 3
void NativeEngine::HandleCommand()
in agdk/agde/endless-tunnel/endless-tunnel/Android/app/src/main/cpp/native_engine.cpp
65 16 1
void PlayScene::DetectCollisions()
in agdk/agde/endless-tunnel/endless-tunnel/Android/app/src/main/cpp/play_scene.cpp
64 17 1
void DemoScene::ConfigureButtonLayout()
in agdk/game_controller/common/demo_scene.cpp
64 7 1
void PlayScene::DetectCollisions()
in agdk/agdktunnel/app/src/main/cpp/play_scene.cpp
64 17 1
Mat4 Mat4::Inverse()
in agdk/agde/Teapot/GameEngine/VecMath.cpp
63 8 0
bool DemoScene::RenderPreferences()
in agdk/game_controller/common/demo_scene.cpp
62 13 0
void Shader::Compile()
in agdk/agde/endless-tunnel/endless-tunnel/Android/app/src/main/cpp/shader.cpp
61 9 0
void Shader::Compile()
in agdk/agdktunnel/app/src/main/cpp/shader.cpp
61 9 0
void GameAssetManagerInternals::SetAssetPackErrorStatus()
in agdk/agdktunnel/app/src/main/cpp/game_asset_manager.cpp
61 16 3
void DemoScene::RenderMouseData()
in agdk/game_controller/common/demo_scene.cpp
58 14 0
void GameAssetManagerInternals::UpdateAssetPackFromDownloadState()
in agdk/agdktunnel/app/src/main/cpp/game_asset_manager.cpp
58 15 2
void SfxMan::PlayTone()
in agdk/agde/endless-tunnel/endless-tunnel/Android/app/src/main/cpp/sfxman.cpp
56 12 1