pytorch / data
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 118 units with 863 lines of code in units (58.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (128 lines of code)
    • 19 small units (280 lines of code)
    • 94 very small units (455 lines of code)
0% | 0% | 14% | 32% | 52%
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% | 14% | 32% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
torchdata/datapipes/iter/util0% | 0% | 16% | 33% | 49%
torchdata/datapipes/iter/load0% | 0% | 13% | 24% | 61%
ROOT0% | 0% | 0% | 72% | 27%
torchdata/datapipes/utils0% | 0% | 0% | 100% | 0%
torchdata/datapipes/iter/transform0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __iter__()
in torchdata/datapipes/iter/util/combining.py
31 10 1
def __iter__()
in torchdata/datapipes/iter/util/hashchecker.py
26 12 1
def __new__()
in torchdata/datapipes/iter/util/cacheholder.py
25 11 7
def _get_response_from_google_drive()
in torchdata/datapipes/iter/load/online.py
25 10 3
def _detect_compression_type()
in torchdata/datapipes/iter/util/extractor.py
21 7 2
def __iter__()
in torchdata/datapipes/iter/load/fsspec.py
20 8 1
def __iter__()
in torchdata/datapipes/iter/util/cacheholder.py
19 7 1
def __iter__()
in torchdata/datapipes/iter/util/samplemultiplexer.py
18 9 1
def __iter__()
in torchdata/datapipes/iter/util/ziparchivereader.py
18 7 1
def __iter__()
in torchdata/datapipes/iter/util/paragraphaggregator.py
18 8 1
def __iter__()
in torchdata/datapipes/iter/util/tararchivereader.py
18 6 1
def _end_caching()
in torchdata/datapipes/iter/util/cacheholder.py
17 1 1
def __iter__()
in torchdata/datapipes/iter/util/rows2columnar.py
15 10 1
def _cache_check_fn()
in torchdata/datapipes/iter/util/cacheholder.py
14 9 5
def __iter__()
in torchdata/datapipes/iter/util/rar_archive_loader.py
14 4 1
def _get_response_from_http()
in torchdata/datapipes/iter/load/online.py
14 5 3
13 4 0
def __len__()
in torchdata/datapipes/iter/util/header.py
13 3 1
def _hash_check()
in torchdata/datapipes/iter/util/cacheholder.py
13 4 3
def validate_pathname_binary_tuple()
in torchdata/datapipes/utils/common.py
12 6 2