facebookresearch / pplbench
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 129 units with 910 lines of code in units (33.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (125 lines of code)
    • 5 medium size units (133 lines of code)
    • 15 small units (207 lines of code)
    • 107 very small units (445 lines of code)
0% | 13% | 14% | 22% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 82% | 0% | 17% | 0%
py0% | 6% | 16% | 23% | 53%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
website/src/pages0% | 82% | 0% | 17% | 0%
pplbench/lib0% | 44% | 0% | 14% | 40%
pplbench/ppls/stan0% | 0% | 26% | 19% | 54%
ROOT0% | 0% | 65% | 0% | 34%
pplbench/ppls/jags0% | 0% | 14% | 27% | 58%
pplbench0% | 0% | 42% | 26% | 32%
pplbench/ppls/pymc30% | 0% | 0% | 58% | 41%
pplbench/models0% | 0% | 0% | 14% | 85%
pplbench/ppls/numpyro0% | 0% | 0% | 0% | 100%
pplbench/ppls0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function Home()
in website/src/pages/index.js
67 3 0
def find_ppl_details()
in pplbench/lib/ppl_helper.py
58 14 1
36 6 1
def pystan_vb_extract()
in pplbench/ppls/stan/inference.py
34 12 1
def extract_data_from_jags()
in pplbench/ppls/jags/n_schools.py
21 2 2
def extract_data_from_stan()
in pplbench/ppls/stan/n_schools.py
21 1 2
def main()
in pplbench/main.py
21 2 1
def extract_data_from_pymc3()
in pplbench/ppls/pymc3/noisy_or_topic.py
19 2 2
def create_output_dir()
in pplbench/lib/utils.py
19 3 1
def get_code()
in pplbench/ppls/jags/noisy_or_topic.py
17 6 1
def extract_data_from_stan()
in pplbench/ppls/stan/crowd_sourced_annotation.py
16 1 2
function Feature()
in website/src/pages/index.js
14 2 3
def get_model()
in pplbench/ppls/pymc3/noisy_or_topic.py
14 4 2
def extract_data_from_jags()
in pplbench/ppls/jags/robust_regression.py
13 1 2
def extract_data_from_stan()
in pplbench/ppls/stan/robust_regression.py
13 1 2
def extract_data_from_pymc3()
in pplbench/ppls/pymc3/robust_regression.py
13 1 2
def configure_logging()
in pplbench/main.py
13 6 2
def get_model()
in pplbench/ppls/pymc3/robust_regression.py
12 1 2
def extract_data_from_jags()
in pplbench/ppls/jags/logistic_regression.py
11 1 2
def extract_data_from_stan()
in pplbench/ppls/stan/logistic_regression.py
11 1 2