facebookresearch / DVDialogues
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 213 units with 4,469 lines of code in units (70.9% of code).
    • 3 very long units (493 lines of code)
    • 10 long units (665 lines of code)
    • 66 medium size units (2,030 lines of code)
    • 58 small units (858 lines of code)
    • 76 very small units (423 lines of code)
11% | 14% | 45% | 19% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 14% | 45% | 19% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dvd_generation/simulators27% | 10% | 43% | 13% | 4%
dvd_generation100% | 0% | 0% | 0% | 0%
dvd_generation/filters0% | 23% | 38% | 30% | 7%
cater_preprocessing0% | 36% | 55% | 2% | 5%
dvd_generation/utils0% | 12% | 60% | 14% | 11%
dvd_codebase/data0% | 10% | 49% | 29% | 9%
notebooks0% | 0% | 100% | 0% | 0%
dvd_generation/question_templates0% | 0% | 0% | 43% | 56%
dvd_codebase0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def instantiate_templates_dfs()
in dvd_generation/simulators/template_dfs.py
200 16 10
def main()
in dvd_generation/generate_dialogues.py
191 66 1
def instantiate_periods()
in dvd_generation/simulators/question_generator.py
102 24 7
def find_all_periods()
in cater_preprocessing/utils.py
95 33 3
def sample_period()
in dvd_generation/filters/dialogue_filters.py
81 32 6
def collate_fn()
in dvd_codebase/data/dataset.py
76 17 2
def sample_period_idx()
in dvd_generation/utils/dialogue_utils.py
64 41 6
def find_all_unique_objects()
in dvd_generation/filters/dialogue_filters.py
63 17 4
def sample_earlier_unique_object()
in dvd_generation/filters/dialogue_filters.py
61 21 2
def make_query_action_handler()
in dvd_generation/simulators/temporal_question_engine.py
61 21 1
def instantiate_last_unique_obj_dependency()
in dvd_generation/simulators/question_generator.py
56 11 6
def sample_unique_answer_obj()
in dvd_generation/utils/dialogue_utils.py
55 21 5
def precompute_obj_identifiers_with_action()
in cater_preprocessing/utils.py
53 21 4
def update_state()
in dvd_generation/simulators/question_engine.py
49 15 9
def get_question_subtype()
in dvd_codebase/data/analysis_utils.py
47 29 2
def get_question_subtype()
in notebooks/utils.py
47 29 2
def create_dials()
in dvd_codebase/data/data_handler.py
44 14 6
def sample_prior_unique_object()
in dvd_generation/filters/dialogue_filters.py
43 16 3
def precompute_actions_filter_options()
in cater_preprocessing/utils.py
41 17 2
def instantiate_attributes()
in dvd_generation/simulators/question_generator.py
41 22 6