facebookresearch / clevr-dataset-gen
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 41 units with 1,007 lines of code in units (81.3% of code).
    • 2 very long units (337 lines of code)
    • 2 long units (166 lines of code)
    • 9 medium size units (272 lines of code)
    • 9 small units (135 lines of code)
    • 19 very small units (97 lines of code)
33% | 16% | 27% | 13% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py33% | 16% | 27% | 13% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
question_generation53% | 0% | 21% | 14% | 10%
image_generation0% | 43% | 35% | 11% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def instantiate_templates_dfs()
in question_generation/generate_questions.py
217 45 7
def main()
in question_generation/generate_questions.py
120 33 1
def render_scene()
in image_generation/render_images.py
83 21 7
def add_random_objects()
in image_generation/render_images.py
83 8 4
def main()
in image_generation/render_images.py
47 9 1
def render_shadeless()
in image_generation/render_images.py
37 2 2
def main()
in image_generation/collect_scenes.py
30 5 1
def insert_scene_node()
in question_generation/question_engine.py
30 9 2
def other_heuristic()
in question_generation/generate_questions.py
30 11 2
def precompute_filter_options()
in question_generation/generate_questions.py
28 13 2
def answer_question()
in question_generation/question_engine.py
24 8 5
def find_relate_filter_options()
in question_generation/generate_questions.py
24 12 6
def add_material()
in image_generation/utils.py
22 4 2
def is_degenerate()
in question_generation/question_engine.py
20 8 5
def compute_all_relationships()
in image_generation/render_images.py
17 10 2
def make_same_attr_handler()
in question_generation/question_engine.py
17 6 1
def make_query_handler()
in question_generation/question_engine.py
15 5 1
def check_visibility()
in image_generation/render_images.py
14 5 2
def add_object()
in image_generation/utils.py
14 4 5
def add_empty_filter_options()
in question_generation/generate_questions.py
13 7 3