microsoft / Azure-Kinect-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 413 units with 7,550 lines of code in units (23.8% of code).
    • 3 very long units (574 lines of code)
    • 25 long units (1,787 lines of code)
    • 78 medium size units (2,462 lines of code)
    • 102 small units (1,469 lines of code)
    • 205 very small units (1,258 lines of code)
7% | 23% | 32% | 19% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp9% | 27% | 29% | 21% | 13%
cs10% | 10% | 40% | 17% | 20%
c0% | 50% | 32% | 11% | 5%
h0% | 0% | 27% | 26% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opencv-kinfu-samples48% | 38% | 5% | 5% | 3%
body-tracking-samples/sample_unity_bodytracking16% | 13% | 28% | 22% | 19%
body-tracking-samples/camera_space_transform_sample75% | 0% | 0% | 24% | 0%
body-tracking-samples/sample_helper_libs0% | 17% | 40% | 19% | 22%
pipe-to-python-samples0% | 100% | 0% | 0% | 0%
body-tracking-samples/simple_3d_viewer0% | 63% | 12% | 22% | 1%
body-tracking-samples/floor_detector_sample0% | 44% | 15% | 20% | 19%
body-tracking-samples/simple_sample0% | 77% | 0% | 22% | 0%
body-tracking-samples/jump_analysis_sample0% | 14% | 36% | 40% | 8%
body-tracking-samples/offline_processor0% | 55% | 30% | 8% | 6%
body-tracking-samples/simple_cpp_sample0% | 71% | 0% | 28% | 0%
build2019/csharp0% | 14% | 56% | 17% | 11%
body-tracking-samples/csharp_3d_viewer0% | 0% | 63% | 5% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in opencv-kinfu-samples/main.cpp
230 28 2
private void InitializeBodyParts()
in body-tracking-samples/sample_unity_bodytracking/Assets/Skeleton/Skeleton.cs
207 1 0
int main()
in body-tracking-samples/camera_space_transform_sample/main.cpp
137 13 0
static void load_GL_VERSION_2_0()
in body-tracking-samples/sample_helper_libs/window_controller_3d/glad/glad.c
96 2 1
void WindowController3d::Create()
in body-tracking-samples/sample_helper_libs/window_controller_3d/WindowController3d.cpp
95 13 5
static void load_GL_VERSION_4_1()
in body-tracking-samples/sample_helper_libs/window_controller_3d/glad/glad.c
92 2 1
int main()
in body-tracking-samples/simple_sample/main.c
88 10 0
static void load_GL_VERSION_3_0()
in body-tracking-samples/sample_helper_libs/window_controller_3d/glad/glad.c
87 2 1
int main()
in body-tracking-samples/jump_analysis_sample/main.cpp
84 9 0
protected override void RunBackgroundThreadAsync()
in body-tracking-samples/sample_unity_bodytracking/Assets/Scripts/SkeletalTrackingProvider.cs
84 10 2
bool process_mkv_offline()
in body-tracking-samples/offline_processor/main.cpp
83 12 2
void Awake()
in body-tracking-samples/sample_unity_bodytracking/Assets/Scripts/TrackerHandler.cs
81 1 0
int _tmain()
in pipe-to-python-samples/main.cpp
80 12 1
DWORD WINAPI InstanceThread()
in pipe-to-python-samples/main.cpp
78 14 1
void PlayFile()
in body-tracking-samples/simple_3d_viewer/main.cpp
72 10 1
static void create_undistortion_lut()
in opencv-kinfu-samples/main.cpp
66 13 5
std::optional Samples::FloorDetector::TryDetectFloorPlane()
in body-tracking-samples/floor_detector_sample/FloorDetector.cpp
65 13 4
int main()
in body-tracking-samples/simple_cpp_sample/main.cpp
65 8 0
static void compute_xy_range()
in opencv-kinfu-samples/main.cpp
65 9 8
int main()
in body-tracking-samples/floor_detector_sample/main.cpp
64 6 0