awslabs / durepa-hybrid-qa
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 121 units with 1,536 lines of code in units (44.2% of code).
    • 1 very long units (129 lines of code)
    • 5 long units (338 lines of code)
    • 16 medium size units (464 lines of code)
    • 16 small units (220 lines of code)
    • 83 very small units (385 lines of code)
8% | 22% | 30% | 14% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 22% | 30% | 14% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT23% | 9% | 38% | 4% | 23%
src0% | 24% | 30% | 14% | 30%
scripts0% | 36% | 17% | 29% | 16%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in run_ranking.py
129 14 0
def main()
in src/run_fusion_in_decoder.py
99 11 0
def evaluation()
in scripts/evaluate_hybrid.py
65 19 4
def _create_examples()
in src/utils_fusion_in_decoder.py
63 18 6
def parse_sql_str()
in scripts/execute_sqls.py
58 11 1
def main()
in run_inference.py
53 5 0
def _parse_data()
in utils_ranking.py
42 16 4
def get_data_examples()
in src/utils_fusion_in_decoder.py
35 14 7
def process_one()
in src/utils_fusion_in_decoder.py
35 8 1
def _create_examples()
in utils_ranking.py
32 5 1
31 13 1
def get_raw_scores()
in scripts/evaluate_script.py
31 12 2
def process_one()
in utils_ranking.py
30 8 1
def process_one()
in src/utils_data.py
30 6 1
def parse_data()
in scripts/prepare_hybrid_ranking_data.py
28 10 3
def process_one()
in utils_ranking.py
27 8 1
def test_epoch_end()
in run_ranking.py
26 8 2
def test_epoch_end()
in src/run_fusion_in_decoder.py
26 7 2
def _generate_beam_search()
in src/run_fusion_in_decoder.py
25 1 0
def _generate()
in src/run_fusion_in_decoder.py
23 1 0