amazon-research / tanl
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 136 units with 2,557 lines of code in units (77.6% of code).
    • 2 very long units (325 lines of code)
    • 10 long units (644 lines of code)
    • 27 medium size units (828 lines of code)
    • 31 small units (471 lines of code)
    • 66 very small units (289 lines of code)
12% | 25% | 32% | 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
py12% | 25% | 32% | 18% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT13% | 23% | 33% | 18% | 11%
preprocess_multiwoz0% | 58% | 18% | 10% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in run.py
210 67 0
115 10 6
def parse_output_sentence()
in output_formats.py
93 42 3
def read_file()
in preprocess_multiwoz/extract_examples.py
90 51 11
64 17 3
61 5 6
60 24 3
60 5 6
58 23 5
55 10 6
def run_inference()
in output_formats.py
52 20 7
51 8 3
50 17 5
47 7 3
44 21 3
38 5 2
37 5 3
36 4 4
35 10 3
33 2 6