amazon-research / embert
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 1,013 units with 26,903 lines of code in units (73.4% of code).
    • 14 very complex units (4,104 lines of code)
    • 41 complex units (5,168 lines of code)
    • 145 medium complex units (8,185 lines of code)
    • 118 simple units (3,207 lines of code)
    • 695 very simple units (6,239 lines of code)
15% | 19% | 30% | 11% | 23%
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
c21% | 25% | 34% | 8% | 9%
py8% | 12% | 25% | 15% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
grolp/gen22% | 23% | 32% | 9% | 11%
scripts10% | 0% | 27% | 25% | 36%
grolp/readers0% | 29% | 28% | 15% | 26%
grolp/models0% | 10% | 18% | 16% | 53%
grolp/eval0% | 21% | 48% | 0% | 29%
grolp/envs0% | 2% | 27% | 15% | 54%
vision0% | 0% | 25% | 22% | 51%
grolp/utils0% | 0% | 25% | 16% | 57%
ROOT0% | 0% | 0% | 35% | 64%
grolp/training0% | 0% | 0% | 14% | 85%
grolp/predictor0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void build_connectivity_graph()
in grolp/gen/ff_planner/inst_final.c
715 210 1
def sample_task_params()
in grolp/gen/scripts/generate_trajectories.py
270 166 9
void create_final_actions()
in grolp/gen/ff_planner/inst_final.c
458 108 1
void build_orig_constant_list()
in grolp/gen/ff_planner/parse.c
412 97 1
def step()
in grolp/gen/game_states/game_state_base.py
344 75 3
void make_normal_effects()
in grolp/gen/ff_planner/inst_pre.c
310 73 2
void normalize_expressions()
in grolp/gen/ff_planner/expressions.c
343 72 1
void collect_relevant_facts_and_fluents()
in grolp/gen/ff_planner/inst_final.c
270 70 1
Bool result_to_dest()
in grolp/gen/ff_planner/search.c
220 68 3
def setup_problem()
in grolp/gen/game_states/task_game_state.py
128 59 5
def run()
in grolp/gen/layouts/precompute_layout_locations.py
184 58 0
def get_instance()
in scripts/generate_landmarks.py
138 54 3
void achieve_goals()
in grolp/gen/ff_planner/relax.c
195 52 1
void get_mneed()
in grolp/gen/ff_planner/relax.c
117 51 3
void create_integer_representation()
in grolp/gen/ff_planner/inst_pre.c
165 50 1
void perform_reachability_analysis()
in grolp/gen/ff_planner/inst_final.c
215 50 1
def main()
in grolp/gen/scripts/generate_trajectories.py
191 46 1
void simplify_wff()
in grolp/gen/ff_planner/inst_pre.c
191 44 1
def get_filter_crit()
in grolp/gen/game_states/task_game_state.py
94 43 2
int main()
in grolp/gen/ff_planner/main.c
229 42 2