facebookresearch / aepsych
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 360 units with 3,452 lines of code in units (9.4% of code).
    • 2 very long units (231 lines of code)
    • 4 long units (295 lines of code)
    • 21 medium size units (652 lines of code)
    • 60 small units (895 lines of code)
    • 273 very small units (1,379 lines of code)
6% | 8% | 18% | 25% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 8% | 22% | 20% | 38%
cs0% | 7% | 8% | 42% | 42%
pyi0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pubs/owenetal52% | 39% | 0% | 4% | 3%
clients/unity0% | 7% | 8% | 42% | 42%
aepsych0% | 5% | 31% | 27% | 36%
aepsych/benchmark0% | 0% | 40% | 19% | 40%
aepsych/generators0% | 0% | 41% | 13% | 44%
aepsych/models0% | 0% | 12% | 29% | 57%
aepsych/database0% | 0% | 11% | 24% | 64%
aepsych/acquisition0% | 0% | 0% | 20% | 79%
aepsych/factory0% | 0% | 0% | 0% | 100%
aepsych/means0% | 0% | 0% | 0% | 100%
clients/matlab0% | 0% | 0% | 0% | 100%
aepsych/kernels0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def plot_novel_lse_grids()
in pubs/owenetal/code/stratplots.py
123 6 3
def plot_acquisition_examples()
in pubs/owenetal/code/stratplots.py
108 12 3
def plot_prior_samps_2d()
in pubs/owenetal/code/prior_plots.py
90 5 0
def plot_prior_samps_1d()
in pubs/owenetal/code/prior_plots.py
86 2 0
public override void OnInspectorGUI()
in clients/unity/Assets/Editor/DemoEditor.cs
67 9 0
def parse_argument()
in aepsych/server.py
52 1 0
def start_server()
in aepsych/server.py
49 11 2
def evaluate()
in aepsych/benchmark/problem.py
48 4 2
42 12 2
def gen()
in aepsych/generators/optimize_acqf_generator.py
42 8 3
def evaluate()
in aepsych/benchmark/problem.py
38 1 2
def replay()
in aepsych/server.py
38 11 3
IEnumerator RunExperiment()
in clients/unity/Assets/Scripts/StratSwitch_2DSingleDetection.cs
37 6 0
void Update()
in clients/unity/Assets/Scripts/ShowKey.cs
33 7 0
def versioned_handler()
in aepsych/server.py
31 8 2
def from_config()
in aepsych/strategy.py
29 5 3
def from_config()
in aepsych/models/monotonic_rejection_gp.py
28 1 2
def from_config()
in aepsych/generators/monotonic_rejection_generator.py
28 1 2
def getLogger()
in aepsych/utils_logging.py
26 1 2
def _get_acqf_options()
in aepsych/generators/base.py
26 7 3