facebookresearch / neural-scs
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 168 units with 2,407 lines of code in units (83.3% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (357 lines of code)
    • 33 medium size units (981 lines of code)
    • 40 small units (580 lines of code)
    • 90 very small units (489 lines of code)
0% | 14% | 40% | 24% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 14% | 40% | 24% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
automl21/scs_neural/experimentation0% | 40% | 42% | 8% | 8%
automl21/scs_neural/solver0% | 8% | 36% | 29% | 25%
automl210% | 20% | 41% | 19% | 18%
automl21/accel0% | 0% | 56% | 25% | 18%
automl21/scs_neural/utils0% | 0% | 49% | 42% | 7%
automl21/scs_neural/problem0% | 0% | 16% | 33% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _learn_batched()
in automl21/scs_neural/experimentation/launcher.py
91 21 1
def solve()
in automl21/scs_neural/solver/neural_scs_batched.py
84 25 10
def _plot_test_results()
in automl21/scs_neural/experimentation/launcher.py
63 17 5
def plot_agg()
in automl21/enr.py
62 2 4
def _extract_aggregate_metrics()
in automl21/scs_neural/experimentation/launcher.py
57 13 4
def _plot_metrics()
in automl21/scs_neural/experimentation/launcher.py
48 16 8
def plot_single()
in automl21/enr.py
42 1 3
def _plot_train_results()
in automl21/scs_neural/experimentation/launcher.py
42 13 5
def init_instance()
in automl21/accel/neural_rec.py
38 11 3
def _normalize_A_sparse()
in automl21/scs_neural/solver/neural_scs_batched.py
38 4 4
def update()
in automl21/accel/neural_aa.py
37 4 4
def _convert_to_sequential_list()
in automl21/scs_neural/solver/neural_scs_batched.py
35 15 4
def init_instance()
in automl21/accel/neural_rec.py
34 11 3
def mlp()
in automl21/accel/utils.py
33 12 7
def plot_aggregate_results()
in automl21/scs_neural/experimentation/launcher.py
33 7 5
def mlp()
in automl21/scs_neural/utils/utils.py
33 12 7
def _compute_residuals_sparse_for_backprop()
in automl21/scs_neural/solver/neural_scs_batched.py
32 4 4
def select_instances_sparse()
in automl21/scs_neural/solver/neural_scs_batched.py
31 11 3
def matvec()
in automl21/scs_neural/solver/linear_operator.py
31 6 2
def update()
in automl21/accel/aa.py
29 4 4