dart-lang / api.dart.dev
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 146 units with 1,210 lines of code in units (78.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 13 medium size units (369 lines of code)
    • 23 small units (328 lines of code)
    • 109 very small units (459 lines of code)
0% | 4% | 30% | 27% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 4% | 30% | 27% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
server/scripts0% | 23% | 21% | 11% | 43%
server/scripts/cloudstorage0% | 0% | 32% | 30% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get()
in server/scripts/redirector.py
54 14 3
def run()
in server/scripts/cloudstorage/api_utils.py
41 10 3
def __iter__()
in server/scripts/cloudstorage/cloudstorage_api.py
39 12 1
def _flush()
in server/scripts/cloudstorage/storage_api.py
39 14 2
def read()
in server/scripts/cloudstorage/storage_api.py
29 10 2
def __init__()
in server/scripts/cloudstorage/storage_api.py
29 4 5
def check_status()
in server/scripts/cloudstorage/errors.py
28 11 7
def __init__()
in server/scripts/cloudstorage/storage_api.py
26 2 5
def __init__()
in server/scripts/cloudstorage/api_utils.py
25 4 10
def resolve_doc_path()
in server/scripts/redirector.py
24 5 2
def redir_old()
in server/scripts/redirector.py
24 4 2
def open()
in server/scripts/cloudstorage/cloudstorage_api.py
23 5 7
def listbucket()
in server/scripts/cloudstorage/cloudstorage_api.py
21 4 7
def __init__()
in server/scripts/cloudstorage/common.py
21 3 8
def readline()
in server/scripts/cloudstorage/storage_api.py
20 6 2
def _send_data()
in server/scripts/cloudstorage/storage_api.py
17 3 4
def do_request_async()
in server/scripts/cloudstorage/rest_api.py
16 1 7
def get_token_async()
in server/scripts/cloudstorage/rest_api.py
16 5 2
def stat()
in server/scripts/cloudstorage/cloudstorage_api.py
16 1 3
def _next_file_gen()
in server/scripts/cloudstorage/cloudstorage_api.py
16 7 2