amazon-research / nlu-slot-constraints
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 39 units with 766 lines of code in units (2.4% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (220 lines of code)
    • 10 medium size units (345 lines of code)
    • 6 small units (92 lines of code)
    • 20 very small units (109 lines of code)
0% | 28% | 45% | 12% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 28% | 45% | 12% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 29% | 42% | 12% | 14%
data0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
88 22 3
77 21 3
55 16 4
45 16 2
44 11 2
def create_csv()
in generate_result_table.py
43 12 1
37 12 2
def entity_sorting()
in entity_linking.py
35 15 5
32 11 2
def entity_linking()
in entity_linking.py
31 13 5
def vocab_process()
in data/vocab_process.py
30 8 1
26 13 5
22 7 1
19 1 2
def get_violation_prob()
in violation_detection.py
16 4 3
def entity_linking_probs()
in entity_linking.py
15 6 5
def passing_atomic_value()
in violation_detection.py
15 9 2
def find_violations()
in violation_detection.py
14 12 3
def find_violations_probs()
in violation_detection.py
13 10 3
def calculate_prf_entity()
in entity_linking.py
10 8 4