amazon-research / panrep
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 368 units with 18,303 lines of code in units (96.9% of code).
    • 46 very long units (11,242 lines of code)
    • 42 long units (2,916 lines of code)
    • 73 medium size units (2,312 lines of code)
    • 69 small units (1,061 lines of code)
    • 138 very small units (772 lines of code)
61% | 15% | 12% | 5% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py61% | 15% | 12% | 5% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
panrep61% | 17% | 12% | 5% | 4%
data_handler/imdb63% | 0% | 19% | 13% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
393 72 0
393 72 0
392 71 0
391 71 0
def finetunedblp_all_signals()
in panrep/plot_data.py
391 71 0
390 71 0
390 71 0
390 71 0
def finetuneimdb_infomax()
in panrep/plot_data.py
390 71 0
389 71 0
def finetunedblp_small()
in panrep/plot_data.py
386 71 0
def finetunedblp_med()
in panrep/plot_data.py
386 71 0
def finetuneimdb_small_no_init()
in panrep/plot_data.py
353 64 0
352 64 0
def evaluation_link_prediction()
in panrep/evaluation.py
351 59 9
350 64 0
344 57 10
def finetuneimdb_tune_ssl_univ()
in panrep/plot_data.py
343 63 0
341 63 0
227 42 0