apple / ml-hypersim
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 110 units with 5,275 lines of code in units (39.7% of code).
    • 11 very long units (3,358 lines of code)
    • 12 long units (826 lines of code)
    • 19 medium size units (571 lines of code)
    • 23 small units (345 lines of code)
    • 45 very small units (175 lines of code)
63% | 15% | 10% | 6% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp72% | 15% | 6% | 2% | 2%
py42% | 15% | 21% | 14% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code/cpp/tools/scene_annotation_tool51% | 26% | 11% | 5% | 4%
code/cpp/tools/generate_camera_trajectory_random_walk100% | 0% | 0% | 0% | 0%
code/cpp/tools/generate_octomap100% | 0% | 0% | 0% | 0%
code/python/analysis84% | 11% | 0% | 2% | <1%
code/python/lib54% | 0% | 33% | 8% | 3%
code/cpp/tools/generate_hdf5_from_exr100% | 0% | 0% | 0% | 0%
code/cpp/tools/generate_oriented_bounding_box100% | 0% | 0% | 0% | 0%
code/cpp/tools/generate_ray_intersections100% | 0% | 0% | 0% | 0%
code/python/tools0% | 33% | 29% | 27% | 9%
code/cpp/tools/generate_octomap_samples0% | 100% | 0% | 0% | 0%
evermotion_dataset0% | 100% | 0% | 0% | 0%
contrib/999910% | 0% | 36% | 36% | 27%
contrib/mikeroberts3000/python0% | 0% | 0% | 87% | 12%
code/python/plots0% | 0% | 0% | 86% | 13%
contrib/mikeroberts3000/jupyter0% | 0% | 0% | 86% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in code/cpp/tools/generate_camera_trajectory_random_walk/main.cpp
665 58 2
int main()
in code/cpp/tools/generate_octomap/main.cpp
469 72 2
void draw_custom_window()
in code/cpp/tools/scene_annotation_tool/main.cpp
427 114 0
def process_scene()
in code/python/analysis/dataset_generate_image_statistics.py
373 48 2
bool remove_vertices_and_faces()
in code/cpp/tools/scene_annotation_tool/main.cpp
283 40 3
bool mouse_up()
in code/cpp/tools/scene_annotation_tool/main.cpp
277 53 3
int main()
in code/cpp/tools/generate_hdf5_from_exr/main.cpp
272 49 2
def load_obj_file()
in code/python/lib/obj_file_utils.py
213 55 1
int main()
in code/cpp/tools/generate_oriented_bounding_box/main.cpp
137 19 2
int main()
in code/cpp/tools/generate_ray_intersections/main.cpp
136 13 2
def generate_camera_trajectory_random_walk()
in code/python/lib/random_walk_utils.py
106 5 17
void load_scene()
in code/cpp/tools/scene_annotation_tool/main.cpp
96 9 1
int main()
in code/cpp/tools/scene_annotation_tool/main.cpp
81 11 2
bool mouse_move()
in code/cpp/tools/scene_annotation_tool/main.cpp
81 20 3
def process_scene()
in code/python/tools/dataset_generate_hdf5_from_vrimg.py
73 14 2
void initialize_tool_state()
in code/cpp/tools/scene_annotation_tool/main.cpp
70 4 0
bool key_pressed()
in code/cpp/tools/scene_annotation_tool/main.cpp
68 13 3
int main()
in code/cpp/tools/generate_octomap_samples/main.cpp
65 13 2
def _set_vray_user_params()
in evermotion_dataset/_vray_user_params.py
65 8 1
def get_strings_for_plugin()
in code/python/tools/generate_node_metadata_from_vrscene.py
62 20 1