awslabs / recurrent-intensity-model-experiments
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 245 units with 2,315 lines of code in units (76.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (62 lines of code)
    • 31 medium size units (871 lines of code)
    • 39 small units (548 lines of code)
    • 174 very small units (834 lines of code)
0% | 2% | 37% | 23% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 2% | 37% | 23% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/rime/util0% | 8% | 21% | 21% | 48%
src/rime/models0% | 0% | 29% | 25% | 44%
src/rime/dataset0% | 0% | 57% | 31% | 11%
src/rime/models/zero_shot0% | 0% | 92% | 7% | 0%
src/rime0% | 0% | 42% | 19% | 37%
src/rime/metrics0% | 0% | 48% | 32% | 18%
data0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def plot_rec_results()
in src/rime/util/plotting.py
62 4 2
def registered()
in src/rime/__init__.py
46 9 1
def create_dataset()
in src/rime/dataset/base.py
43 2 4
def prepare_minimal_dataset()
in src/rime/dataset/__init__.py
37 6 0
def get_stats()
in src/rime/dataset/base.py
34 3 1
def fit()
in src/rime/models/bpr.py
34 5 2
def fit()
in src/rime/models/graph_conv.py
34 8 2
def prepare_ml_1m_data()
in src/rime/dataset/prepare_ml_1m_data.py
33 4 5
def dual_solve_u()
in src/rime/util/cvx_bisect.py
32 9 7
def __init__()
in src/rime/models/zero_shot/item_knn.py
32 9 9
def eval()
in src/rime/util/score_array.py
31 10 2
def __init__()
in src/rime/models/zero_shot/bayes_lm.py
30 6 12
def transform()
in src/rime/models/zero_shot/bayes_lm.py
30 5 2
def __init__()
in src/rime/models/graph_conv.py
29 7 19
def run()
in src/rime/__init__.py
28 12 6
def assign_mtch()
in src/rime/metrics/matching.py
27 5 6
def reindex()
in src/rime/util/score_array.py
26 6 4
def _compute_log_p_x_given_y()
in src/rime/models/zero_shot/bayes_lm.py
26 8 4
def plot_mtch_results()
in src/rime/util/plotting.py
25 5 2
def _mtch_update()
in src/rime/__init__.py
24 5 5