facebookresearch / Project_FARSI
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,043 units with 15,088 lines of code in units (90.2% of code).
    • 17 very long units (2,636 lines of code)
    • 44 long units (2,996 lines of code)
    • 128 medium size units (4,105 lines of code)
    • 172 small units (2,543 lines of code)
    • 682 very small units (2,808 lines of code)
17% | 19% | 27% | 16% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py17% | 19% | 27% | 16% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
visualization_utils29% | 32% | 28% | 7% | 2%
DSE_utils17% | 15% | 35% | 17% | 14%
design_utils6% | 11% | 24% | 22% | 34%
data_collection39% | 29% | 20% | 5% | 5%
top0% | 0% | 60% | 39% | 0%
SIM_utils0% | 0% | 0% | 60% | 39%
misc0% | 0% | 0% | 67% | 32%
error_handling0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_memory_system_attr()
in design_utils/design.py
304 60 1
def barplot_moves()
in visualization_utils/plot.py
281 37 1
def write_one_results()
in data_collection/collection_utils/what_ifs/FARSI_what_ifs.py
198 97 7
def sel_moves_based_on_dis()
in DSE_utils/hill_climbing.py
178 45 2
def get_budget_optimality_for_paper()
in visualization_utils/plotting.py
161 36 4
def log_data()
in DSE_utils/hill_climbing.py
156 16 2
141 67 2
def plot_sim_data()
in visualization_utils/vis_sim.py
139 36 3
def plot_convergence_per_workloads()
in visualization_utils/plotting.py
130 32 2
def SA_design_selection()
in DSE_utils/hill_climbing.py
128 37 6
def plot_convergence_per_workloads_for_paper()
in visualization_utils/plotting.py
127 32 2
125 27 2
def plot_codesign_nav_breakdown_cross_workload()
in visualization_utils/plotting-ying.py
125 59 2
def get_compute_system_attr()
in design_utils/design.py
116 37 1
111 18 2
def plot_codesign_rate_efficacy_cross_workloads_updated()
in visualization_utils/plotting-ying.py
108 18 2
def plot_codesign_rate_efficacy_per_workloads()
in visualization_utils/plotting-ying.py
108 21 2
def apply_move()
in design_utils/des_handler.py
100 30 3
def infer_local_buses_attr()
in design_utils/design.py
97 22 1
def input_error_output_cost_sensitivity_study()
in data_collection/collection_utils/what_ifs/FARSI_what_ifs.py
93 14 4