microsoft / Azure-Kinect-Sensor-SDK
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,318 units with 27,214 lines of code in units (59.5% of code).
    • 41 very long units (6,977 lines of code)
    • 74 long units (4,970 lines of code)
    • 238 medium size units (7,564 lines of code)
    • 270 small units (3,941 lines of code)
    • 695 very small units (3,762 lines of code)
25% | 18% | 27% | 14% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp40% | 17% | 26% | 7% | 8%
c23% | 26% | 29% | 12% | 9%
cs11% | 7% | 24% | 35% | 21%
py0% | 16% | 44% | 19% | 19%
h0% | 9% | 31% | 22% | 36%
hpp0% | 0% | 4% | 40% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/color63% | 14% | 11% | 6% | 3%
src/record41% | 22% | 25% | 4% | 6%
tools/k4aviewer14% | 13% | 36% | 14% | 21%
src/transformation29% | 32% | 29% | 4% | 4%
tools/k4arecorder77% | 0% | 13% | 7% | 1%
src/usbcommand40% | 21% | 25% | 11% | <1%
tools/k4afastcapture_streaming72% | 0% | 11% | 12% | 3%
src/csharp15% | 2% | 21% | 34% | 25%
src/sdk24% | 19% | 16% | 10% | 28%
src/dewrapper44% | 11% | 28% | 13% | 1%
src/capturesync49% | 0% | 38% | 9% | 2%
src/image42% | 0% | 24% | 3% | 28%
tools/updater17% | 35% | 32% | 12% | 1%
src/imu47% | 0% | 27% | 24% | 0%
src/calibration16% | 50% | 25% | 7% | 0%
src/firmware0% | 58% | 30% | 7% | 3%
src/python0% | 13% | 44% | 20% | 20%
src/tewrapper0% | 58% | 31% | 6% | 2%
src/logging0% | 80% | 13% | 0% | 6%
src/depth0% | 43% | 38% | 14% | 3%
scripts0% | 24% | 38% | 34% | 2%
tools/k4afastcapture_trigger0% | 100% | 0% | 0% | 0%
src/dynlib0% | 31% | 48% | 15% | 4%
src/queue0% | 31% | 31% | 18% | 19%
src/depth_mcu0% | 18% | 50% | 29% | 1%
cmake0% | 72% | 27% | 0% | 0%
include/k4ainternal0% | 19% | 56% | 11% | 13%
src/allocator0% | 0% | 35% | 45% | 18%
src/color_mcu0% | 0% | 41% | 37% | 20%
src/deloader0% | 0% | 37% | 25% | 37%
tools/deversion0% | 0% | 90% | 0% | 9%
include/k4a0% | 0% | 4% | 35% | 60%
include/k4arecord0% | 0% | 5% | 49% | 45%
src/math0% | 0% | 0% | 32% | 67%
src/global0% | 0% | 0% | 66% | 33%
src/rwlock0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
K4ADockControlStatus K4ADeviceDockControl::Show()
in tools/k4aviewer/k4adevicedockcontrol.cpp
462 86 0
416 55 2
k4a_result_t parse_recording_config()
in src/record/internal/matroska_read.cpp
334 62 1
int main()
in tools/k4arecorder/main.cpp
318 43 2
k4a_result_t k4a_record_create()
in src/record/sdk/record.cpp
308 53 4
public static extern k4a_result_t k4a_set_allocator()
in src/csharp/SDK/Native/NativeMethods.cs
280 1 2
240 55 2
k4a_result_t UVCCameraReader::SetCameraControl()
in src/color/uvc_camerareader.cpp
206 37 3
static int depth_engine_thread()
in src/dewrapper/dewrapper.c
198 35 1
int do_recording()
in tools/k4arecorder/recorder.cpp
182 38 7
k4a_result_t convert_block_to_image()
in src/record/internal/matroska_read.cpp
180 30 4
k4a_result_t CMFCameraReader::Start()
in src/color/mfcamerareader.cpp
178 29 6
k4a_result_t UVCCameraReader::GetCameraControl()
in src/color/uvc_camerareader.cpp
175 29 3
void capturesync_add_capture()
in src/capturesync/capturesync.c
174 37 4
k4a_result_t image_create()
in src/image/image.c
172 31 6
k4a_stream_result_t get_capture()
in src/record/internal/matroska_read.cpp
151 44 3
147 13 2
void UVCCameraReader::Callback()
in src/color/uvc_camerareader.cpp
144 24 1
k4a_result_t parse_mkv()
in src/record/internal/matroska_read.cpp
143 28 1
void K4AWindowDock::Show()
in tools/k4aviewer/k4awindowdock.cpp
143 32 2