kubernetes / website
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 31 units with 563 lines of code in units (1.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (141 lines of code)
    • 5 medium size units (163 lines of code)
    • 13 small units (184 lines of code)
    • 11 very small units (75 lines of code)
0% | 25% | 28% | 32% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 28% | 32% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
update-imported-docs0% | 52% | 21% | 20% | 5%
scripts0% | 15% | 31% | 37% | 16%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in update-imported-docs/update-imported-docs.py
79 16 0
def process_diff_status()
in scripts/diff_l10n_branches.py
62 14 5
def check_target()
in scripts/linkchecker.py
49 29 3
def validate_links()
in scripts/linkchecker.py
32 9 1
def process_file()
in update-imported-docs/update-imported-docs.py
32 8 6
def main()
in scripts/linkchecker.py
28 7 0
def strip_comments()
in scripts/linkchecker.py
22 7 1
def get_redirect()
in scripts/linkchecker.py
19 6 1
def process_links()
in update-imported-docs/update-imported-docs.py
19 5 3
def new_record()
in scripts/linkchecker.py
16 6 3
def check_ctrlcode()
in scripts/check-ctrlcode.py
15 5 1
def check_file_exists()
in scripts/linkchecker.py
15 6 3
def check_anchor()
in scripts/linkchecker.py
15 3 2
def parse_arguments()
in scripts/linkchecker.py
14 1 0
def main()
in scripts/diff_l10n_branches.py
13 1 4
def main()
in scripts/check-ctrlcode.py
12 3 0
def check_dir()
in scripts/check-ctrlcode.py
12 5 2
def process_kubectl_links()
in update-imported-docs/update-imported-docs.py
12 3 1
def main()
in scripts/upstream_changes.py
11 2 3
def dump_result()
in scripts/linkchecker.py
11 4 0