awslabs / aws-cv-unique-information
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 154 units with 2,942 lines of code in units (90.6% of code).
    • 4 very long units (432 lines of code)
    • 6 long units (463 lines of code)
    • 38 medium size units (1,156 lines of code)
    • 38 small units (551 lines of code)
    • 68 very small units (340 lines of code)
14% | 15% | 39% | 18% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py14% | 15% | 39% | 18% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts28% | 16% | 27% | 25% | 1%
modules0% | 11% | 56% | 10% | 21%
archive0% | 100% | 0% | 0% | 0%
methods0% | 0% | 48% | 19% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in sample_info/scripts/data_summarization.py
118 8 0
def main()
in sample_info/scripts/ground_truth_effects.py
107 9 0
def main()
in sample_info/scripts/compute_influence_functions_brute_force.py
106 19 0
def main()
in sample_info/scripts/compute_informativeness.py
101 5 0
def main()
in sample_info/scripts/compute_influence_functions.py
96 17 0
def main()
in sample_info/scripts/prepare_informativeness_orders_for_data_summarization.py
86 7 0
def main()
in sample_info/archive/total_gradient.py
84 4 0
def main()
in sample_info/scripts/train_classifier.py
72 3 0
def weight_stability()
in sample_info/modules/stability.py
68 17 16
def plot_summary_of_informativeness()
in sample_info/modules/visualizations.py
57 13 7
def compute_jacobian()
in sample_info/modules/ntk.py
49 15 10
def prepare_needed_items()
in sample_info/modules/ntk.py
49 9 7
def main()
in sample_info/scripts/synthetic_example_make_informativeness_video.py
49 3 0
def get_weights_at_time_t()
in sample_info/modules/ntk.py
46 16 13
def main()
in sample_info/scripts/aggregate_data_summarization_results.py
44 13 0
def test_pred_stability()
in sample_info/modules/stability.py
40 6 10
def parse_network_from_config()
in sample_info/modules/nn_utils.py
40 15 3
def plot_histogram_of_informativeness()
in sample_info/modules/visualizations.py
38 10 9
def get_sgd_covariance_diagonal()
in sample_info/modules/sgd.py
37 12 7
def main()
in sample_info/scripts/aggregate_ground_truth_results.py
37 7 0