amazon-research / embert
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 1,013 units with 26,903 lines of code in units (73.4% of code).
    • 57 very long units (10,006 lines of code)
    • 77 long units (5,094 lines of code)
    • 186 medium size units (6,343 lines of code)
    • 210 small units (3,065 lines of code)
    • 483 very small units (2,395 lines of code)
37% | 18% | 23% | 11% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c48% | 23% | 19% | 7% | 1%
py25% | 13% | 28% | 15% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
grolp/gen46% | 22% | 18% | 8% | 3%
grolp/readers41% | 14% | 21% | 9% | 13%
grolp/eval55% | 6% | 25% | 7% | 5%
grolp/models20% | 11% | 29% | 18% | 21%
scripts10% | 11% | 45% | 19% | 11%
grolp/envs0% | 13% | 37% | 31% | 16%
vision0% | 11% | 45% | 13% | 29%
ROOT0% | 31% | 35% | 18% | 13%
grolp/utils0% | 6% | 32% | 26% | 34%
grolp/training0% | 0% | 42% | 14% | 43%
grolp/predictor0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void build_connectivity_graph()
in grolp/gen/ff_planner/inst_final.c
715 210 1
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 normalize_expressions()
in grolp/gen/ff_planner/expressions.c
343 72 1
void make_normal_effects()
in grolp/gen/ff_planner/inst_pre.c
310 73 2
void collect_relevant_facts_and_fluents()
in grolp/gen/ff_planner/inst_final.c
270 70 1
def sample_task_params()
in grolp/gen/scripts/generate_trajectories.py
270 166 9
int main()
in grolp/gen/ff_planner/main.c
229 42 2
Bool result_to_dest()
in grolp/gen/ff_planner/search.c
220 68 3
void perform_reachability_analysis()
in grolp/gen/ff_planner/inst_final.c
215 50 1
def from_pretrained()
in grolp/models/embodied_bert.py
212 34 5
def evaluate()
in grolp/eval/eval_task.py
202 20 12
def evaluate()
in grolp/eval/eval_subgoals.py
201 28 15
void achieve_goals()
in grolp/gen/ff_planner/relax.c
195 52 1
void simplify_wff()
in grolp/gen/ff_planner/inst_pre.c
191 44 1
def main()
in grolp/gen/scripts/generate_trajectories.py
191 46 1
void create_hard_mixed_operators()
in grolp/gen/ff_planner/inst_hard.c
185 37 2
def run()
in grolp/gen/layouts/precompute_layout_locations.py
184 58 0
void split_domain()
in grolp/gen/ff_planner/inst_pre.c
167 38 1