pytorch / hub
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 10 units with 108 lines of code in units (83.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (22 lines of code)
    • 2 small units (33 lines of code)
    • 7 very small units (53 lines of code)
0% | 0% | 20% | 30% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 20% | 30% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts0% | 0% | 20% | 30% | 49%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def validate_header()
in scripts/sanity_check.py
22 8 2
def check_markdown_file()
in scripts/sanity_check.py
19 6 1
def validate_markdown()
in scripts/sanity_check.py
14 8 2
def __init__()
in scripts/sanity_check.py
9 1 2
def validate_tags()
in scripts/sanity_check.py
9 3 2
def validate_link()
in scripts/sanity_check.py
9 2 2
def validate_image()
in scripts/sanity_check.py
9 3 2
def validate_category()
in scripts/sanity_check.py
8 2 2
def sanity_check()
in scripts/sanity_check.py
5 3 0
def no_extra_colon()
in scripts/sanity_check.py
4 1 3