facebookresearch / irt-leaderboard
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 431 units with 6,771 lines of code in units (64.8% of code).
    • 4 very long units (522 lines of code)
    • 23 long units (1,555 lines of code)
    • 72 medium size units (2,264 lines of code)
    • 81 small units (1,169 lines of code)
    • 251 very small units (1,261 lines of code)
7% | 22% | 33% | 17% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 23% | 30% | 18% | 19%
tsx0% | 24% | 58% | 8% | 8%
ts0% | 0% | 88% | 11% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
leaderboard12% | 23% | 26% | 17% | 19%
leaderboard/irt/pyirt0% | 54% | 19% | 11% | 14%
frontend/src0% | 21% | 62% | 8% | 7%
leaderboard/www0% | 36% | 32% | 12% | 17%
scripts0% | 7% | 55% | 23% | 13%
leaderboard/analysis0% | 0% | 31% | 43% | 25%
leaderboard/irt0% | 0% | 23% | 13% | 62%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def confusion_plot()
in leaderboard/plots.py
150 5 3
def ablation_plot()
in leaderboard/plots.py
138 23 2
def main()
in leaderboard/visualize.py
128 4 0
def generate_examples()
in leaderboard/linear.py
106 30 1
def create_irt_dist_chart()
in leaderboard/plots.py
97 4 1
renderPlotControls()
in frontend/src/Leaderboard.tsx
87 5 0
def create_irt_dist_chart()
in leaderboard/visualize.py
84 4 1
def guide_hierarchical()
in leaderboard/irt/pyirt/multidim_one_param_logistic.py
84 1 4
def run_test()
in leaderboard/stats.py
81 12 2
def rank_correlation_table()
in leaderboard/plots.py
73 6 3
def rank_stability_plot()
in leaderboard/plots.py
70 2 2
def plot_irt_acc()
in leaderboard/plots.py
68 11 2
def plot_irt_comparison()
in leaderboard/plots.py
67 4 2
def guide_hierarchical()
in leaderboard/irt/pyirt/three_param_logistic.py
65 1 4
def guide_hierarchical()
in leaderboard/irt/pyirt/two_param_logistic.py
65 1 4
renderSubmissionTable()
in frontend/src/Leaderboard.tsx
64 2 0
def sample_stability_plot()
in leaderboard/plots.py
64 2 2
def cat_sample_stability_plot()
in leaderboard/plots.py
64 2 2
def model_hierarchical()
in leaderboard/irt/pyirt/three_param_logistic.py
64 2 4
def _fetch_leaderboard()
in scripts/competitiond.py
64 16 1