facebookresearch / dynalab
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 83 units with 1,235 lines of code in units (87.0% of code).
    • 1 very long units (137 lines of code)
    • 5 long units (385 lines of code)
    • 10 medium size units (250 lines of code)
    • 17 small units (243 lines of code)
    • 50 very small units (220 lines of code)
11% | 31% | 20% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 31% | 20% | 19% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dynalab_cli15% | 35% | 19% | 13% | 16%
dynalab/tasks0% | 23% | 24% | 34% | 18%
dynalab/handler0% | 0% | 0% | 72% | 27%
dynalab0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_docker_test()
in dynalab_cli/test.py
137 9 2
def run_command()
in dynalab_cli/upload.py
96 7 1
def add_args()
in dynalab_cli/init.py
85 1 1
def get_mock_data()
in dynalab/tasks/task_io.py
77 9 1
def run_command()
in dynalab_cli/init.py
65 9 1
def validate_config()
in dynalab_cli/utils.py
62 13 1
def mock_handle_individually()
in dynalab/tasks/task_io.py
31 6 4
def initialize_paths()
in dynalab_cli/init.py
27 9 3
def mock_handle_with_batching()
in dynalab/tasks/task_io.py
26 5 4
def run_command()
in dynalab_cli/test.py
26 9 1
def initialize_path()
in dynalab_cli/init.py
26 7 3
def verify_response()
in dynalab/tasks/task_io.py
24 7 3
24 8 3
def create_file()
in dynalab_cli/init.py
24 4 2
def login()
in dynalab_cli/utils.py
21 3 0
def initialize_task()
in dynalab_cli/init.py
21 4 3
def __init__()
in dynalab_cli/utils.py
20 1 3
def write_exclude_filelist()
in dynalab_cli/utils.py
20 11 4
def test_endpoint_individually()
in dynalab/tasks/task_io.py
19 3 2
def run_local_test()
in dynalab_cli/test.py
18 2 2