facebookresearch / DVDialogues
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 213 units with 4,469 lines of code in units (70.9% of code).
    • 1 very complex units (191 lines of code)
    • 5 complex units (334 lines of code)
    • 49 medium complex units (2,003 lines of code)
    • 51 simple units (1,019 lines of code)
    • 107 very simple units (922 lines of code)
4% | 7% | 44% | 22% | 20%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py4% | 7% | 44% | 22% | 20%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dvd_generation100% | 0% | 0% | 0% | 0%
cater_preprocessing0% | 23% | 68% | 2% | 5%
dvd_generation/filters0% | 9% | 43% | 32% | 14%
dvd_generation/utils0% | 6% | 44% | 29% | 19%
dvd_codebase/data0% | 6% | 30% | 26% | 36%
notebooks0% | 67% | 32% | 0% | 0%
dvd_generation/simulators0% | 0% | 62% | 20% | 17%
dvd_generation/question_templates0% | 0% | 0% | 21% | 78%
dvd_codebase0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in dvd_generation/generate_dialogues.py
191 66 1
def sample_period_idx()
in dvd_generation/utils/dialogue_utils.py
64 41 6
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 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 is_valid_dialogue()
in dvd_generation/filters/dialogue_filters.py
40 24 2
def instantiate_periods()
in dvd_generation/simulators/question_generator.py
102 24 7
def instantiate_attributes()
in dvd_generation/simulators/question_generator.py
41 22 6
def precompute_obj_identifiers_with_action()
in cater_preprocessing/utils.py
53 21 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 sample_unique_answer_obj()
in dvd_generation/utils/dialogue_utils.py
55 21 5
def contain_shape_size_filter()
in dvd_generation/filters/spatial_constraint_filters.py
31 20 7
def sample_unique_answer_action()
in dvd_generation/utils/dialogue_utils.py
36 20 4
def get_filter_options()
in dvd_generation/filters/scene_filters.py
35 18 6
def get_vocabulary()
in dvd_codebase/data/data_handler.py
32 18 3
def precompute_actions_filter_options()
in cater_preprocessing/utils.py
41 17 2
def find_relate_filter_options()
in dvd_generation/filters/scene_filters.py
35 17 9
def find_all_unique_objects()
in dvd_generation/filters/dialogue_filters.py
63 17 4